@bobfrankston/jgrep
Recursive grep tailored for TypeScript / JavaScript source trees.
By default jgrep searches .ts files (and .js files only when no
sibling .ts exists), skips node_modules, prev, recycle bins, and
hidden directories, and follows real paths to avoid revisiting the same
directory through symlinks/junctions.
Install
npm install -g @bobfrankston/jgrep
Usage
jgrep [options] pattern [startdir ...]
If no starting directories are given, jgrep searches y:\dev,
y:\inetpub, and y:\x\bin (with WSL-style path translation when not
on Windows).
Options
-c | Include comments when matching lines (default: strip // from non-TS files) |
-s / -show | Show each matching line with the match highlighted |
-v / -verbose | Verbose output (line text after each hit) |
-d<n> | Print directory names up to depth n while traversing |
-ext .x .y | Add file extensions to consider (in addition to .ts) |
-n / -name / -names | Match filenames against glob patterns (e.g. *.json, package.*) |
Examples
jgrep "TODO" y:\dev\utils
jgrep -ext .json -n package.* "homepage"
jgrep -s "RMFLogger"
Develop
tsc -w
node .
The compiled index.js is the bin entry, so npm link or
npm install -g . makes jgrep available on PATH.