ltebean / detector

Scan files to find whether certain text pattern exists

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Scan files to find whether certain text pattern exists.

Installation

npm install -g pattern-detector

Usage


Options:

  -d, --directory [directory path]     root directory to search from, defaults to pwd
  -p, --pattern [text pattern]         text pattern to find
  -e, --exclusion [exclusion pattern]  exclusive file pattern
  -v, --verbose                        verbose output

Example

Find whether require() is called in the current working direcotry, ignoring certain files:

detect -p 'require(.+)' -e 'node_modules|.git|README'

The output will be:

./bin/detector.js line 3
./bin/detector.js line 4
./bin/detector.js line 5

About

Scan files to find whether certain text pattern exists


Languages

Language:JavaScript 100.0%