@bobfrankston/jgrep
v1.0.3
Published
Recursive grep for TypeScript/JavaScript source trees, with comment-stripping and filename-glob filters
Downloads
169
Maintainers
Readme
@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/jgrepUsage
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
| Flag | Meaning |
|------|---------|
| -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 # rebuild on save
node . # run locallyThe compiled index.js is the bin entry, so npm link or
npm install -g . makes jgrep available on PATH.
