1.0.0 • Published 2 years ago

extract-strings v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

extract-strings

Extracts string literals from js files using the babel parser.

Installation

$ npm install -g extract-strings 

Usage

Usage: cli [options]

Options:
  -f, --files <glob>           glob pattern of the files to read
  -s, --skipPattern <pattern>  regex pattern for skipping files
  -h, --help                   display help for command

Example

files:

// myJsFile.js
console.log("abc", "def");
// myOtherJsFile.js
const x = "this is a string";

console.log(x);
$ extract-strings --files "./**/*.js"
./myJsFile.js
        l:      1       c:      19              def
        l:      1       c:      12              abc

./myOtherJsFile.js
        l:      1       c:      10              this is a string
$ extract-strings --files "./**/*.js" --skipPattern "myOther"
skipped files
./myOtherJsFile.js

./myJsFile.js
        l:      1       c:      19              def
        l:      1       c:      12              abc