codestrings ๐Ÿ”ค

strings but for your source code.

Extracts all the strings from your code.

Use Cases ๐Ÿง‘โ€๐Ÿ’ป

  • Facilitate translation of hard-coded text strings
  • Quick glance at what a code is “saying” by looking at the strings within it (?)
  • NLP (?)

Features โšก

  • Extract to json or csv
  • Multiple files at once
  • Single executable

So far, this has been only tested with Javascript.

Usage โš™๏ธ

codestrings [parameters] file1,file2,file3,...

Parameters

  --delimiters
        delimiters to use for string extraction (comma separated and escaped) (default "\",',`")
  --output
        output type: json, csv (default "csv")

Examples ๐Ÿงช

Let’s say you have this javascript file called example.js.

function greet(name) {
  console.log(`Hello ${name}`);
}

var fname = "John";
const lname = "Doe";
let age = 42;
let address = {
  street: "123 Main St",
  city: "New York",
  state: "NY",
};

You can extract all the strings from this file with:

codestrings example.js

The output will be:

example.js,"Hello ${name}","John","Doe","123 Main St","New York","NY"

Roadmap ๐Ÿ›ฃ๏ธ

  • Add more tests especially with more programming languages

  • Improve algorithm performance

License ๐Ÿ“ƒ

MIT

GitHub

View Github