Fast, lightweight, asynchronous directory scanner built on micromatch
const deified = require('deified');
const config = { //optional - all configuration has intuitive defaults
filter: {
regexes: ['/?test/'] //defaults to filter out hidden files and node_modules
},
glob: {
globs: ['**/*.js'], //passed to micromatch - defaults to [**/*]
options: {}, //options for micromatch mm() - defaults to undefied
},
scan: {
options: { encoding: 'utf8' } //options for readdir - defaults to undefined
}
};
const deify = deified.configure(config);
const paths = await deify({ directory: __dirname }); //pass the directory to scan - defaults to cwd
This is a Node.js module available through the npm registry.
Before installing, download and install Node.js. Node.js 8.11.1 or higher is required.
Installation is done using the
npm install
command:
npm install deified
- Based on the fast micromatch
- Filters apply during directory scanning to eliminate unnessesary IO
- Globs apply after scanning to fine tune results
- IO uses asynchronous filesystem calls
- Filters remove paths that match (negative)
- Globs keep paths that match (postive)
To run the test suite, first install the dependencies, then run npm test
:
npm install
npm test
The original author of deified is Phillip Smith
The current lead maintainer is Phillip Smith