{"_id":"readdir-glob","_rev":"3218814","name":"readdir-glob","description":"Recursive fs.readdir with streaming API and glob filtering.","dist-tags":{"latest":"1.1.3"},"maintainers":[{"name":"yqnn","email":""}],"time":{"modified":"2024-03-21T07:20:48.000Z","created":"2020-07-22T12:35:38.614Z","1.1.3":"2023-04-05T19:13:06.840Z","1.1.2":"2022-07-01T18:04:56.038Z","1.1.1":"2020-10-06T22:03:33.433Z","1.1.0":"2020-09-21T21:29:31.920Z","1.0.0":"2020-07-22T12:35:38.614Z"},"users":{},"author":{"name":"Yann Armelin"},"repository":{"type":"git","url":"git://github.com/Yqnn/node-readdir-glob.git"},"versions":{"1.1.3":{"author":{"name":"Yann Armelin"},"name":"readdir-glob","description":"Recursive fs.readdir with streaming API and glob filtering.","version":"1.1.3","homepage":"https://github.com/Yqnn/node-readdir-glob","repository":{"type":"git","url":"git://github.com/Yqnn/node-readdir-glob.git"},"main":"index.js","dependencies":{"minimatch":"^5.1.0"},"devDependencies":{"jasmine":"^4.6.0","mkdirp":"^2.1.6","nyc":"^15.1.0","rimraf":"^3.0.2","tick":"0.0.6"},"keywords":["recursive","fs","stream","streams","readdir","filesystem","find","filter","glob"],"scripts":{"test":"npx nyc --reporter=lcov --reporter=text-summary --reporter=html jasmine --config=jasmine.json","test-regen":"TEST_REGEN=1 jasmine --config=jasmine.json","bench":"bash scripts/benchmark.sh","profile":"bash scripts/profile.sh && cat profile.txt"},"license":"Apache-2.0","gitHead":"4b8c7d169824af423113de31b15189ad28746fcd","bugs":{"url":"https://github.com/Yqnn/node-readdir-glob/issues"},"_id":"readdir-glob@1.1.3","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"shasum":"c3d831f51f5e7bfa62fa2ffbe4b508c640f09584","size":8059,"noattachment":false,"key":"/readdir-glob/-/readdir-glob-1.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/readdir-glob/download/readdir-glob-1.1.3.tgz"},"_npmUser":{"name":"yqnn","email":"ynn@free.fr"},"directories":{},"maintainers":[{"name":"yqnn","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/readdir-glob_1.1.3_1680721986659_0.9138951939715061"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-04-05T19:13:06.840Z","publish_time":1680721986840,"_cnpm_publish_time":1680721986840},"1.1.2":{"author":{"name":"Yann Armelin"},"name":"readdir-glob","description":"Recursive fs.readdir with streaming API and glob filtering.","version":"1.1.2","homepage":"https://github.com/Yqnn/node-readdir-glob","repository":{"type":"git","url":"git://github.com/Yqnn/node-readdir-glob.git"},"main":"index.js","dependencies":{"minimatch":"^5.1.0"},"devDependencies":{"jasmine":"^3.9.0","mkdirp":"^1.0.4","nyc":"^15.1.0","rimraf":"^3.0.2","tick":"0.0.6"},"keywords":["recursive","fs","stream","streams","readdir","filesystem","find","filter","glob"],"scripts":{"test":"npx nyc --reporter=lcov --reporter=text-summary --reporter=html jasmine --config=jasmine.json","test-regen":"TEST_REGEN=1 jest --coverage","bench":"bash scripts/benchmark.sh","profile":"bash scripts/profile.sh && cat profile.txt"},"license":"Apache-2.0","gitHead":"b87c97e5ee47834d0b8aa48212d5244204566d1c","bugs":{"url":"https://github.com/Yqnn/node-readdir-glob/issues"},"_id":"readdir-glob@1.1.2","_nodeVersion":"16.13.0","_npmVersion":"8.3.2","dist":{"shasum":"b185789b8e6a43491635b6953295c5c5e3fd224c","size":8050,"noattachment":false,"key":"/readdir-glob/-/readdir-glob-1.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/readdir-glob/download/readdir-glob-1.1.2.tgz"},"_npmUser":{"name":"yqnn","email":"ynn@free.fr"},"directories":{},"maintainers":[{"name":"yqnn","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/readdir-glob_1.1.2_1656698695853_0.11773616474845405"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-07-01T18:14:36.426Z","publish_time":1656698696038,"_cnpm_publish_time":1656698696038},"1.1.1":{"author":{"name":"Yann Armelin"},"name":"readdir-glob","description":"Recursive fs.readdir with streaming API and glob filtering.","version":"1.1.1","homepage":"https://github.com/Yqnn/node-readdir-glob","repository":{"type":"git","url":"git://github.com/Yqnn/node-readdir-glob.git"},"main":"index.js","dependencies":{"minimatch":"^3.0.4"},"devDependencies":{"coveralls":"^3.1.0","jest":"^25.5.4","mkdirp":"^1.0.0","path-is-absolute":"^1.0.0","rimraf":"^2.2.8","tick":"0.0.6"},"keywords":["recursive","fs","stream","streams","readdir","filesystem","find","filter","glob"],"scripts":{"test":"jest --coverage","test-regen":"TEST_REGEN=1 jest --coverage","coveralls":"jest --coverage && cat ./coverage/lcov.info | coveralls","bench":"bash scripts/benchmark.sh","profile":"bash scripts/profile.sh && cat profile.txt"},"license":"Apache-2.0","gitHead":"c4087e26217c5caf55ce7f269d6f2c0de5a75301","bugs":{"url":"https://github.com/Yqnn/node-readdir-glob/issues"},"_id":"readdir-glob@1.1.1","_nodeVersion":"12.18.4","_npmVersion":"6.14.6","dist":{"shasum":"f0e10bb7bf7bfa7e0add8baffdc54c3f7dbee6c4","size":7873,"noattachment":false,"key":"/readdir-glob/-/readdir-glob-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/readdir-glob/download/readdir-glob-1.1.1.tgz"},"maintainers":[{"name":"yqnn","email":""}],"_npmUser":{"name":"yqnn","email":"ynn@free.fr"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/readdir-glob_1.1.1_1602021813333_0.3556821262237304"},"_hasShrinkwrap":false,"publish_time":1602021813433,"_cnpm_publish_time":1602021813433},"1.1.0":{"author":{"name":"Yann Armelin"},"name":"readdir-glob","description":"Recursive fs.readdir with streaming API and glob filtering.","version":"1.1.0","homepage":"https://github.com/Yqnn/node-readdir-glob","repository":{"type":"git","url":"git://github.com/Yqnn/node-readdir-glob.git"},"main":"index.js","dependencies":{"minimatch":"^3.0.4"},"devDependencies":{"coveralls":"^3.1.0","jest":"^26.1.0","mkdirp":"^1.0.0","path-is-absolute":"^1.0.0","rimraf":"^2.2.8","tick":"0.0.6"},"keywords":["recursive","fs","stream","streams","readdir","filesystem","find","filter","glob"],"scripts":{"test":"jest --coverage","test-regen":"TEST_REGEN=1 jest --coverage","coveralls":"jest --coverage && cat ./coverage/lcov.info | coveralls","bench":"bash scripts/benchmark.sh","profile":"bash scripts/profile.sh && cat profile.txt"},"license":"Apache-2.0","gitHead":"2a97b77ccb030cedc2b8d55c82f0a3e12beb9312","bugs":{"url":"https://github.com/Yqnn/node-readdir-glob/issues"},"_id":"readdir-glob@1.1.0","_nodeVersion":"12.16.3","_npmVersion":"6.14.4","dist":{"shasum":"a3def6f7b61343e8a1274dbb872b9a2ad055d086","size":7745,"noattachment":false,"key":"/readdir-glob/-/readdir-glob-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/readdir-glob/download/readdir-glob-1.1.0.tgz"},"maintainers":[{"name":"yqnn","email":""}],"_npmUser":{"name":"yqnn","email":"ynn@free.fr"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/readdir-glob_1.1.0_1600723771786_0.10314907017893082"},"_hasShrinkwrap":false,"publish_time":1600723771920,"_cnpm_publish_time":1600723771920},"1.0.0":{"author":{"name":"Yann Armelin"},"name":"readdir-glob","description":"Recursive fs.readdir with streaming API and glob filtering.","version":"1.0.0","homepage":"https://github.com/Yqnn/node-readdir-glob","repository":{"type":"git","url":"git://github.com/Yqnn/node-readdir-glob.git"},"main":"index.js","dependencies":{"minimatch":"^3.0.4"},"devDependencies":{"jest":"^26.1.0","mkdirp":"^1.0.0","path-is-absolute":"^1.0.0","rimraf":"^2.2.8","tick":"0.0.6"},"keywords":["recursive","fs","stream","streams","readdir","filesystem","find","filter","glob"],"scripts":{"test":"jest --collect-coverage","test-regen":"TEST_REGEN=1 jest --collect-coverage","bench":"bash scripts/benchmark.sh","profile":"bash scripts/profile.sh && cat profile.txt"},"license":"Apache-2.0","gitHead":"cc5370eab4649bd093292d37ada8a6bc0d993ad5","bugs":{"url":"https://github.com/Yqnn/node-readdir-glob/issues"},"_id":"readdir-glob@1.0.0","_nodeVersion":"12.16.3","_npmVersion":"6.14.4","dist":{"shasum":"a495436934bbe57be6a68039d16e8946621eb8c5","size":7409,"noattachment":false,"key":"/readdir-glob/-/readdir-glob-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/readdir-glob/download/readdir-glob-1.0.0.tgz"},"maintainers":[{"name":"yqnn","email":""}],"_npmUser":{"name":"yqnn","email":"ynn@free.fr"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/readdir-glob_1.0.0_1595421338474_0.6720568650751251"},"_hasShrinkwrap":false,"publish_time":1595421338614,"_cnpm_publish_time":1595421338614}},"readme":"# Readdir-Glob\n![Build Status](https://github.com/Yqnn/node-readdir-glob/actions/workflows/test.yml/badge.svg?branch=master) [![Coverage Status](https://coveralls.io/repos/github/Yqnn/node-readdir-glob/badge.svg?branch=master)](https://coveralls.io/github/Yqnn/node-readdir-glob?branch=master)\n\nRecursive version of fs.readdir wih stream API and glob filtering.\nUses the `minimatch` library to do its matching.\n\nRequires Node.js 10.0 or later.\n\n## Performances\n\nCompared to `glob`, `readdir-glob` is memory efficient: no matter the file system size, or the number of returned files, the memory usage is constant.\n\nThe CPU cost is proportional to the number of files in `root` folder, minus the number files in `options.skip` folders.\n\n**Advice**: For better performances use `options.skip` to restrict the search as much as possible.\n\n## Usage\n\nInstall with npm\n```\nnpm i readdir-glob\n```\n\n```javascript\nconst readdirGlob = require('readdir-glob');\nconst globber = readdirGlob('.', {pattern: '**/*.js'});\nglobber.on('match', match => {\n    // m.relative: relative path of the matched file\n    // m.absolute: absolute path of the matched file\n    // m.stat: stat of the matched file (only if stat:true option is used)\n});\nglobber.on('error', err => {\n    console.error('fatal error', err);\n});\nglobber.on('end', (m) => {\n    console.log('done');\n});\n```\n\n## readdirGlob(root, [options])\n\n* `root` `{String}` Path to be read recursively, *default*: `'.'`\n* `options` `{Object}` Options, *default*: `{}`\n\nReturns a EventEmitter reading given root recursively.\n\n### Properties\n\n* `options`: The options object passed in.\n* `paused`: Boolean which is set to true when calling `pause()`.\n* `aborted` Boolean which is set to true when calling `abort()`.  There is no way at this time to continue a glob search after aborting.\n\n### Events\n\n* `match`: Every time a match is found, this is emitted with the specific thing that matched.\n* `end`: When the matching is finished, this is emitted with all the matches found. \n* `error`: Emitted when an unexpected error is encountered.\n\n### Methods\n\n* `pause()`: Temporarily stop the search\n* `resume()`: Resume the search\n* `abort()`: Stop the search forever\n\n### Options\n\n* `pattern`: Glob pattern or Array of Glob patterns to match the found files with. A file has to match at least one of the provided patterns to be returned.\n* `ignore`: Glob pattern or Array of Glob patterns to exclude matches. If a file or a folder matches at least one of the provided patterns, it's not returned. It doesn't prevent files from folder content to be returned. Note: `ignore` patterns are *always* in `dot:true` mode.\n* `skip`: Glob pattern or Array of Glob patterns to exclude folders. If a folder matches one of the provided patterns, it's not returned, and it's not explored: this prevents any of its children to be returned. Note: `skip` patterns are *always* in `dot:true` mode.\n* `mark`: Add a `/` character to directory matches.\n* `stat`: Set to true to stat *all* results.  This reduces performance.\n* `silent`: When an unusual error is encountered when attempting to read a directory, a warning will be printed to stderr.  Set the `silent` option to true to suppress these warnings.\n* `nodir`: Do not match directories, only files.\n* `follow`: Follow symlinked directories. Note that requires to stat *all* results, and so reduces performance.\n\nThe following options apply only if `pattern` option is set, and are forwarded to `minimatch`:\n* `dot`: Allow `pattern` to match filenames starting with a period, even if the pattern does not explicitly have a period in that spot.\n* `noglobstar`: Disable `**` matching against multiple folder names.\n* `nocase`: Perform a case-insensitive match.  Note: on case-insensitive filesystems, non-magic patterns will match by default, since `stat` and `readdir` will not raise errors.\n* `matchBase`: Perform a basename-only match if the pattern does not  contain any slash characters.  That is, `*.js` would be treated as equivalent to `**/*.js`, matching all js files in all directories.\n\n\n## References\n\nUnit-test set is based on [node-glob](https://www.npmjs.com/package/glob) tests.\n","_attachments":{},"homepage":"https://github.com/Yqnn/node-readdir-glob","bugs":{"url":"https://github.com/Yqnn/node-readdir-glob/issues"},"license":"Apache-2.0"}