{"_id":"scan-directory","_rev":"2840730","name":"scan-directory","description":"[![NPM](https://nodei.co/npm/scan-directory.png?downloads=true&stars=true)](https://nodei.co/npm/scan-directory/)","dist-tags":{"latest":"2.0.0"},"maintainers":[{"name":"kashey","email":""}],"time":{"modified":"2022-09-06T15:52:33.000Z","created":"2017-11-29T10:43:47.415Z","2.0.0":"2019-10-23T22:22:53.407Z","1.0.0":"2017-11-29T10:43:47.415Z"},"users":{},"author":{"name":"Anton Korzunov","url":"thekashey@gmail.com"},"versions":{"2.0.0":{"name":"scan-directory","version":"2.0.0","description":"[![NPM](https://nodei.co/npm/scan-directory.png?downloads=true&stars=true)](https://nodei.co/npm/scan-directory/)","main":"dist/es2015/index.js","scripts":{"test":"npm run test:pick -- '_tests/**/*spec.js'","test:pick":"BABEL_ENV=es2015 mocha --compilers js:babel-core/register","build:es5":"NODE_ENV=es5 babel src -d dist/es5","build:es2015":"NODE_ENV=es2015 babel src -d dist/es2015","build":"npm run build:es5 & npm run build:es2015","prepublish":"npm run build","perf":"npm run build && node perf/index.js"},"author":{"name":"Anton Korzunov","url":"thekashey@gmail.com"},"license":"ISC","devDependencies":{"@babel/cli":"^7.6.4","@babel/core":"^7.6.4","@babel/preset-env":"^7.6.3","benchmark":"^2.1.4","chai":"^4.1.2","mocha":"^4.0.1","totalist":"^1.0.0"},"gitHead":"037a55cffbdbcf17f227c402c72e2796dce51dec","_id":"scan-directory@2.0.0","_nodeVersion":"10.15.3","_npmVersion":"6.10.2","dist":{"shasum":"99fcb923ca26b8e2541cc3afb34d50cf494ea65f","size":1732,"noattachment":false,"key":"/scan-directory/-/scan-directory-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/scan-directory/download/scan-directory-2.0.0.tgz"},"maintainers":[{"name":"kashey","email":""}],"_npmUser":{"name":"kashey","email":"thekashey@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/scan-directory_2.0.0_1571869373252_0.9577125874340986"},"_hasShrinkwrap":false,"publish_time":1571869373407,"_cnpm_publish_time":1571869373407,"_cnpmcore_publish_time":"2021-12-19T00:29:19.009Z"},"1.0.0":{"name":"scan-directory","version":"1.0.0","description":"[![NPM](https://nodei.co/npm/scan-directory.png?downloads=true&stars=true)](https://nodei.co/npm/scan-directory/)","main":"dist/index.js","scripts":{"test":"npm run test:pick -- '_tests/**/*spec.js'","test:pick":"BABEL_ENV=cjs mocha --compilers js:babel-core/register","build":"babel src -d dist","prepublish":"npm run build"},"author":{"name":"Anton Korzunov","url":"thekashey@gmail.com"},"license":"ISC","devDependencies":{"babel-cli":"^6.26.0","babel-preset-env":"^1.6.1","chai":"^4.1.2","mocha":"^4.0.1"},"gitHead":"e256e57a98028485cb0c43d6fb0b8ce98b36efe1","_id":"scan-directory@1.0.0","_npmVersion":"5.5.1","_nodeVersion":"9.0.0","_npmUser":{"name":"kashey","email":"thekashey@gmail.com"},"dist":{"shasum":"46b6769dbd893d9bd7490ae9dcc43811a38b7fbb","size":18656,"noattachment":false,"key":"/scan-directory/-/scan-directory-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/scan-directory/download/scan-directory-1.0.0.tgz"},"maintainers":[{"name":"kashey","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/scan-directory-1.0.0.tgz_1511952227285_0.4061568146571517"},"directories":{},"publish_time":1511952227415,"_hasShrinkwrap":false,"_cnpm_publish_time":1511952227415,"_cnpmcore_publish_time":"2021-12-19T00:29:19.263Z"}},"readme":"[![NPM](https://nodei.co/npm/scan-directory.png?downloads=true&stars=true)](https://nodei.co/npm/scan-directory/)\n\n__Blazing fast__ directory scan. Uses async/await underneath, doing all the stuff in async and parallel way.\n \n#Usage\n\n```javascript\nimport scan, {forExt} from 'scan-directory';\n\nconst list = await scan(\n   directory: string, \n   acceptFunction, \n   [rejectFunction=skipNodeModules]\n);\n```\nFor example\n```js\nconst list = await scan(\n  __dirName,    // where \n  forExt('js'), // what\n  (fileName) => fileName.match(somePattern)) // what NOT\n```\n\nWhere acceptFunction and rejectFunction - `(fileName:string, stat) => boolean`.\n\n# Node 8?\n`scan-directory` is bundled for __node 10__.\n\nFor older node versions use `scan-directory/cjs` entry point (no async/await)\n","_attachments":{},"license":"ISC"}