2.0.0 • Published 7 years ago
read-dir-recur v2.0.0
read-dir-recur
Recursively read directories
Table of Contents
Install
This project uses node and npm.
$ npm install read-dir-recur
$ # OR
$ yarn add read-dir-recurUsage
When reading dir with this structure:
bar/
├── baaa
├── baz.js
├── ping.js
└── pong.mdconst readDirRecur = require('read-dir-recur')
console.log(readDirRecur({ readFile: false, pattern: '*.js', ignore: ['baaa'], base: ROOT_DIR }))
// { bar:
// [ { base: 'bar', name: 'baz.js', ext: '.js', size: 0 },
// { base: 'bar', name: 'ping.js', ext: '.js', size: 0 } ] }Uses micromatch for pattern and ignore of files.
Contribute
- Fork it and create your feature branch:
git checkout -b my-new-feature - Commit your changes:
git commit -am "Add some feature" - Push to the branch:
git push origin my-new-feature - Submit a pull request
License
MIT