Flexible search of file content
const {core} = require('@zkud/fs-find');
const {Searcher, Query} = core;
const searcher = new Searcher();
const results = await searcher.search(
new Query()
.from('./src/')
.filterBy(({path}) => path.endsWith('.js'))
.mapAs((content) => content.match(/class/g))
.reduceAs((a, b) => a.concat(b), []),
);
// -> ['class', 'class', ...]
console.log(results);
This is a Node.js module available through the npm registry.
Before installing, download and install Node.js. Node.js 16.* or higher is required.
If this is a brand new project, make sure to create a package.json
first with
the npm init
command.
Installation is done using the
npm install
command:
$ npm install @zkud/fs-find
- Performant cached FILTER-MAP-REDUCE read-only queries to a file system
- Super-high test coverage
- High flexibility to use your own file systems / specific searches
If you discover a security vulnerability, please see Security Policies and Procedures.