tiny-fsearch
Fast and Simple File Search for NodeJS. Versatile find-in-files/search methods that can take in a range of options.
Getting Started
tiny-fsearch
is a native Node module available via NPM. It can be installed with.
$ npm install --save tiny-fsearch
Usage
The module consists of two available functions and a promisified alternative.
const fsearch = require('tiny-fsearch');
fsearch.sync(source, predicate, options);
fsearch.stream(source, predicate, options);
fsearch.concurrent(source, predicate, options);
Options
source [string]
A file or directory in which to search in.
predicate [string|RegExp]
The string or RegExp to use for matching.
options [fsearch.IOptions]
The available options exposed for setting different search parameters are:
interface fsearch.IOptions {
exclude: string[];
ignoreCase: boolean;
matchWholeWord: boolean;
}
Results
Matched results with be in the form of:
interface fsearch.IMatch {
readonly line: number;
readonly column: number;
readonly length: number;
readonly filePath: number;
}
License
MIT