{"_id":"sb-scandir","_rev":"9-344bb5d5dc12e9fe10f3ab46282ba237","name":"sb-scandir","dist-tags":{"latest":"3.1.1"},"versions":{"1.0.0":{"name":"sb-scandir","version":"1.0.0","keywords":["scandir","steelbrain","files","scan"],"author":{"name":"steelbrain"},"license":"MIT","_id":"sb-scandir@1.0.0","maintainers":[{"name":"steelbrain","email":"i@steelbrain.me"}],"homepage":"https://github.com/steelbrain/scandir#readme","bugs":{"url":"https://github.com/steelbrain/scandir/issues"},"dist":{"shasum":"102b4666c7b644f4287f0d33ceb4374fac1bfa15","tarball":"https://registry.npmjs.org/sb-scandir/-/sb-scandir-1.0.0.tgz","integrity":"sha512-0rKtb7W2BwMThDuF8p1ulU0reC8KHBGQEmHlEJ2NHWBRlFT4etj/1DZ8bGujqGIXoY4BztozLo8YSAdHT7Fd7A==","signatures":[{"sig":"MEQCIFKDnpD5zyRLJBWPpbq5isBPCkL6/rdwK4NnSZqBR1nQAiAowrIvT85F8In5i6ndd/2xRNPCj0OtSYecNZQgHT57dg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/index.js","_from":".","_shasum":"102b4666c7b644f4287f0d33ceb4374fac1bfa15","gitHead":"cb7a24293d5f0ebecbbc8d364829c283b8a8ce47","scripts":{"test":"(apm test) && (flow check | grep -q '0 errors') && (eslint . )","build":"npm run clean; babel src --out-dir lib","clean":"rm -rf lib","watch":"npm run clean; babel src --out-dir lib --watch"},"_npmUser":{"name":"steelbrain","email":"i@steelbrain.me"},"repository":{"url":"git+https://github.com/steelbrain/scandir.git","type":"git"},"_npmVersion":"3.10.3","description":"File scanning module for Node.js","directories":{},"_nodeVersion":"6.3.1","dependencies":{"sb-promisify":"^1.3.0"},"devDependencies":{"flow-bin":"^0.30.0","babel-cli":"^6.11.4","jasmine-fix":"^1.0.1","babel-preset-steelbrain":"^4.0.2","eslint-config-steelbrain":"^1.0.4"},"_npmOperationalInternal":{"tmp":"tmp/sb-scandir-1.0.0.tgz_1471818684600_0.959653042955324","host":"packages-12-west.internal.npmjs.com"}},"2.0.0":{"name":"sb-scandir","version":"2.0.0","keywords":["scandir","steelbrain","files","scan"],"author":{"name":"steelbrain"},"license":"MIT","_id":"sb-scandir@2.0.0","maintainers":[{"name":"steelbrain","email":"i@steelbrain.me"}],"homepage":"https://github.com/steelbrain/scandir#readme","bugs":{"url":"https://github.com/steelbrain/scandir/issues"},"dist":{"shasum":"a02ad1fa44a8bd2bfaf30193d14d23c2f35ab6b2","tarball":"https://registry.npmjs.org/sb-scandir/-/sb-scandir-2.0.0.tgz","integrity":"sha512-SKbyMJB0DUt9OgN4tP2RBcn9OsR26DEpe+nwaDkQTNcrJSJI0FlLhXhBpTd/YEnlQ2GdLrbszSNekGLw4rweOQ==","signatures":[{"sig":"MEQCIGUic+mb46zVxdRR+EJvalrV254MVN2thsfR6hXZjFqCAiAi6XN+mO8tOSRRncEtnjZGC9n8fyU9tcsFOg6RSmuG4w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/index.js","gitHead":"8db7360559199a5e64974f29cb8ea1fb2fec247a","scripts":{"test":"(apm test) && (flow check) && (eslint . )","build":"npm run clean; babel src --out-dir lib","clean":"rm -rf lib","watch":"npm run clean; babel src --out-dir lib --watch"},"_npmUser":{"name":"steelbrain","email":"i@steelbrain.me"},"repository":{"url":"git+https://github.com/steelbrain/scandir.git","type":"git"},"_npmVersion":"5.4.2","description":"File scanning module for Node.js","directories":{},"_nodeVersion":"8.5.0","dependencies":{"p-map":"^1.2.0","sb-promisify":"^2.0.1"},"devDependencies":{"flow-bin":"^0.54.1","babel-cli":"^6.11.4","jasmine-fix":"^1.0.1","babel-preset-steelbrain":"^5.0.0","eslint-config-steelbrain":"^3.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sb-scandir-2.0.0.tgz_1505722743056_0.014746511355042458","host":"s3://npm-registry-packages"}},"3.0.0":{"name":"sb-scandir","version":"3.0.0","keywords":["scandir","steelbrain","files","scan"],"author":{"name":"steelbrain"},"license":"MIT","_id":"sb-scandir@3.0.0","maintainers":[{"name":"steelbrain","email":"i@steelbrain.me"}],"homepage":"https://github.com/steelbrain/scandir#readme","bugs":{"url":"https://github.com/steelbrain/scandir/issues"},"ava":{"files":["test/*-test.ts"],"require":["ts-node/register/transpile-only"],"extensions":["ts"]},"dist":{"shasum":"b2f462094f661f12a089f55139b8edbf5ce5b088","tarball":"https://registry.npmjs.org/sb-scandir/-/sb-scandir-3.0.0.tgz","fileCount":7,"integrity":"sha512-QH1L5cxhRcXI440ShNCPkxQBkzAqWe4je0FoWvfOB1+LDtWYGCJrbn8jK41qBqGqccFw0Mg8OmhR6cHnr3/rfw==","signatures":[{"sig":"MEQCIHuEb9gUQaWUPETVtlVoz+z8MGoHXu3bOSjn9kDbAcyqAiBIbuHtDQ2OX9/Ia+bxvnHqjTJKQYqriZsg9rNStMB5UQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":17596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJer0rSCRA9TVsSAnZWagAA4dIP/RQhuCDJzsSZ3ZgRWJVk\nxZ5MveyfnTp4/JwzB4x4p5tdfYZR2Rl3mprv7bcSDh6HThLnEi3f/ODOXcOh\nKYdTc8gBZVuOIe/TKQB1wD6KHn0JxJYb72yhddlOsuxUHZsesWq5sK1AMQgR\nbmctcV0c3uQif57g4SovFx9FxUQyzzutP1DrtRP6zakhNgCpXroIAKA1pasL\nfQxws7awaQzwfSpt8imrqhv99nWTH6UMJ1XTzci5UASOUNQbbXXQmWfhuEuT\nATNwCu37Y2q0jNIDM/9pdVs4du8GJVHB4Ff3D82hPESPN6Di6BMEH7LzZJy7\nmvyrvkFgJt5nrDp+gFFzlAIDXwGjJe5ruBUFeIl2xZjtGL2AGlg94zNeVvVF\nhYR9fzbGQd0g9fq15qCjUCrzgGZoNiY1WtXvv3t2q/butb2SA2dMpdjL8FY0\nKUJZ3JJRYLh6JNIc6fyLU+RwPpXs2LI1Hi4xYxLd4B6+qjKZ0L7UImh16qfw\nMvldwDPlxGVgJR4mlKjCMqMigQVieVt5ucXpiirmMMjPM9ikHouvv4OPghEv\ndVO758ZOl+W8VWws6OAqBzRxFhK4jsxhQ7glZZe6rewQiukyqHHG17kfQgNv\ncniQfFrWhjD3hjq8vxwaH+/7u/EN9FCeGs1BiWrcEueyJJAuUuxxG/2izNQG\nMdIG\r\n=dIgE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/cjs/index.js","module":"lib/esm/index.js","engines":{"node":">= 8"},"gitHead":"f83d78572ded695c218a51e2e5877b655f68155b","scripts":{"lint":"(tsc -p . --noEmit) && (eslint . --ext .ts) && (prettier --list-different src/*.ts)","test":"ava","prepare":"yarn build:clean ; yarn build:esm ; yarn build:cjs ; yarn build:typings","build:cjs":"tsc --module commonjs --target es5 --outDir lib/cjs","build:esm":"tsc --module es2015 --target es2018 --outDir lib/esm","build:clean":"rm -rf lib","build:typings":"tsc --declaration --outDir lib/typings --emitDeclarationOnly"},"typings":"lib/typings/index.d.ts","_npmUser":{"name":"steelbrain","email":"i@steelbrain.me"},"repository":{"url":"git+https://github.com/steelbrain/scandir.git","type":"git"},"_npmVersion":"6.14.4","description":"File scanning module for Node.js","directories":{},"_nodeVersion":"12.16.2","dependencies":{"sb-promise-queue":"^2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.7.0","ts-node":"^8.8.2","typescript":"^3.8.3","eslint-config-steelbrain":"^9.0.1"},"_npmOperationalInternal":{"tmp":"tmp/sb-scandir_3.0.0_1588546258394_0.7572883903304541","host":"s3://npm-registry-packages"}},"3.1.0":{"name":"sb-scandir","version":"3.1.0","keywords":["scandir","steelbrain","files","scan"],"author":{"name":"steelbrain"},"license":"MIT","_id":"sb-scandir@3.1.0","maintainers":[{"name":"steelbrain","email":"i@steelbrain.me"}],"homepage":"https://github.com/steelbrain/scandir#readme","bugs":{"url":"https://github.com/steelbrain/scandir/issues"},"ava":{"files":["test/*-test.ts"],"require":["ts-node/register/transpile-only"],"extensions":["ts"]},"dist":{"shasum":"31c346abb5184b73c5a25b286858f4299aa8756c","tarball":"https://registry.npmjs.org/sb-scandir/-/sb-scandir-3.1.0.tgz","fileCount":7,"integrity":"sha512-70BVm2xz9jn94zSQdpvYrEG101/UV9TVGcfWr9T5iob3QhCK4lYXeculfBqPGFv3XTeKgx4dpWyYIDeZUqo4kg==","signatures":[{"sig":"MEQCIBF1S2cphxC9MO4IHedfqsVG3cK/os3JdD1GybG40jvkAiAbqDm0Rms3alzHHrn0m3VhaqO7GzrzpIfA/brgqBhIHg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":18057,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKBYPCRA9TVsSAnZWagAAkbgP/1DAI0QYW0wz/cWJ+bCG\nBqY2O/0uBypVvGa/f8HNZ/f0rViEmU/T7tODKVI9y25NkUu0r1RU9dRoATGL\nsJBTjp+xrBh3bPHtV6Ez5DcwAk3pI8ITnwptYyAtAJJUWTbencalAD//PVo6\nremW7bz78cH4Y5insluYSiowFlmHAi1xpWBumqYDXVlfOvSMo8faqEmx/8iF\nQlfT8GchJtvm/rqjb3vD3pX13lyQyJsOCsRG8jxjG6WWvfvgFTF6ScKUw4IT\nSUMTNoA60PDjjRjrtf3lRqFhvBYt/++sOWMl617z/gMTBZtXuc32ASyC1JiH\nWS1aGmQaXaUzR6MAC7CSeEHXwjbIOzq12/U0s/MwAwCi9dGc7Sx6Kocs7dq2\nVfx0UPHdGkohJB59Kw25K7MANpc4N8yCIgsgEKy8QhVWYQtCVsHb3cMuoZCi\nLYmoffZAsnAYTVtNKGmm6DQ3pXS0Q/8MA3tYlC9CBm2rvJtuMAiXvcDTNe8U\nQp0Hsty9h9OOHbDQL6HIdlkaO/VPTPaJ3A/ZiBAFZVRgCAubcouaWGk/AA5G\n2wyCPJHea2QKoGCycAA0BUBe3JH4HKW0aDwYRwebnYep9RUb/R93XnOTOX6D\ntetvXEsbCN61jJGpot7UqhoCdVZhPyC0wi+s44GbCpVXq/tiQnrWn6DkgnRt\nSEz6\r\n=Gz4+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/cjs/index.js","type":"commonjs","module":"lib/esm/index.mjs","engines":{"node":">= 8"},"exports":{".":{"import":"./lib/esm/index.mjs","require":"./lib/cjs/index.js"},"./package.json":"./package.json"},"gitHead":"fd28020965ebf7567f35d1133dfb5f3fc46ef42f","scripts":{"lint":"(tsc -p . --noEmit) && (eslint . --ext .ts) && (prettier --list-different src/*.ts)","test":"ava","prepare":"yarn build:clean ; yarn build:esm ; yarn build:cjs ; yarn build:typings","build:cjs":"tsc --module commonjs --target es5 --outDir lib/cjs","build:esm":"tsc --module es2015 --target es2018 --outDir lib/esm && mv lib/esm/index.js lib/esm/index.mjs","build:clean":"rm -rf lib","build:typings":"tsc --declaration --outDir lib/typings --emitDeclarationOnly"},"typings":"lib/typings/index.d.ts","_npmUser":{"name":"steelbrain","email":"i@steelbrain.me"},"repository":{"url":"git+https://github.com/steelbrain/scandir.git","type":"git"},"_npmVersion":"6.14.7","description":"File scanning module for Node.js","directories":{},"_nodeVersion":"14.7.0","dependencies":{"sb-promise-queue":"^2.1.0"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.11.1","ts-node":"^8.10.2","typescript":"^3.9.7","eslint-config-steelbrain":"^10.0.0-beta2"},"_npmOperationalInternal":{"tmp":"tmp/sb-scandir_3.1.0_1596462606623_0.7380826594377083","host":"s3://npm-registry-packages"}},"3.1.1":{"name":"sb-scandir","version":"3.1.1","description":"File scanning module for Node.js","main":"lib/cjs/index.js","typings":"lib/typings/index.d.ts","module":"lib/esm/index.mjs","exports":{".":{"types":"./lib/typings/index.d.ts","import":"./lib/esm/index.mjs","require":"./lib/cjs/index.js"},"./package.json":"./package.json"},"type":"commonjs","scripts":{"test":"ava","lint":"(tsc -p . --noEmit) && (eslint . --ext .ts) && (prettier --list-different src/*.ts)","prepare":"yarn build:clean ; yarn build:esm ; yarn build:cjs ; yarn build:typings","build:clean":"rm -rf lib","build:esm":"tsc --module es2015 --target es2018 --outDir lib/esm && mv lib/esm/index.js lib/esm/index.mjs","build:cjs":"tsc --module commonjs --target es5 --outDir lib/cjs","build:typings":"tsc --declaration --outDir lib/typings --emitDeclarationOnly"},"repository":{"type":"git","url":"git+https://github.com/steelbrain/scandir.git"},"keywords":["scandir","steelbrain","files","scan"],"author":{"name":"steelbrain"},"license":"MIT","bugs":{"url":"https://github.com/steelbrain/scandir/issues"},"homepage":"https://github.com/steelbrain/scandir#readme","devDependencies":{"ava":"^3.11.1","eslint-config-steelbrain":"^10.0.0-beta2","ts-node":"^8.10.2","typescript":"^3.9.7"},"dependencies":{"sb-promise-queue":"^2.1.0"},"ava":{"files":["test/*-test.ts"],"extensions":["ts"],"require":["ts-node/register/transpile-only"]},"engines":{"node":">= 8"},"packageManager":"yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e","_id":"sb-scandir@3.1.1","gitHead":"2baf3e6304b647655af9d2f6eba5f139dbdc4e16","_nodeVersion":"22.15.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-Q5xiQMtoragW9z8YsVYTAZcew+cRzdVBefPbb9theaIKw6cBo34WonP9qOCTKgyAmn/Ch5gmtAxT/krUgMILpA==","shasum":"4792a74ef75e17c2e49c0466f738013fe8698eb8","tarball":"https://registry.npmjs.org/sb-scandir/-/sb-scandir-3.1.1.tgz","fileCount":6,"unpackedSize":17538,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIES5iexUeV3RODuq7zDZiy9NQS1s5qgAGlhQh3ZDvQmjAiEA0BSbJF92nikeoiCoaRQ6ZfXpZV2iO5juy9HrAivdP2E="}]},"_npmUser":{"name":"steelbrain","email":"hello@aneesiqbal.ai"},"directories":{},"maintainers":[{"name":"steelbrain","email":"hello@aneesiqbal.ai"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sb-scandir_3.1.1_1749047285366_0.2633250722425087"},"_hasShrinkwrap":false}},"time":{"created":"2016-08-21T22:31:26.394Z","modified":"2025-06-04T14:28:05.741Z","1.0.0":"2016-08-21T22:31:26.394Z","2.0.0":"2017-09-18T08:19:04.087Z","3.0.0":"2020-05-03T22:50:58.519Z","3.1.0":"2020-08-03T13:50:06.736Z","3.1.1":"2025-06-04T14:28:05.566Z"},"bugs":{"url":"https://github.com/steelbrain/scandir/issues"},"author":{"name":"steelbrain"},"license":"MIT","homepage":"https://github.com/steelbrain/scandir#readme","keywords":["scandir","steelbrain","files","scan"],"repository":{"type":"git","url":"git+https://github.com/steelbrain/scandir.git"},"description":"File scanning module for Node.js","maintainers":[{"name":"steelbrain","email":"hello@aneesiqbal.ai"}],"readme":"# ScanDir\n\n`sb-scandir` is a node module that supports simple file scanning with some sugar features.\n\n## Installation\n\n```\nnpm install --save sb-scandir\n```\n\n## API\n\n```js\ninterface Result {\n files: Array\n directories: Array\n}\n\ninterface FileSystem {\n join(pathA: string, pathB: string): string\n basename(path: string): string\n stat(path: string): Promise\n readdir(path: string): Promise\n}\n\ntype Validate = (path: string) => boolean\n\nexport const defaultFilesystem: FileSystem;\n\nexport default async function scanDirectory(\n path: string,\n {\n recursive = true,\n validate = null,\n concurrency = Infinity,\n fileSystem = defaultFilesystem,\n }: {\n recursive?: boolean\n validate?: Validate | null\n concurrency?: number\n fileSystem?: Partial\n } = {},\n): Promise;\n```\n\n## Examples\n\n```js\nimport Path from 'path'\nimport scandir, { defaultFilesystem } from 'sb-scandir'\n// or\nconst { default: scandir, defaultFilesystem } = require('sb-scandir')\n\n// Scan all files except the dot ones\nscandir(__dirname).then(function(result) {\n console.log('files', result.files)\n console.log('directories', result.directories)\n})\n\n// Scan all top level files except dot ones\nscandir(__dirname, { recursive: false }).then(function(files) {\n console.log('files', result.files)\n console.log('directories', result.directories)\n})\n\n// Scan all files even the dot ones\nscandir(__dirname, { recursive: true, validate(path) {\n return true\n}}).then(function(files) {\n console.log('files', result.files)\n console.log('directories', result.directories)\n})\n\n// Scan all files except in .git and node_modules\nscandir(__dirname, { recursive: true, validate(path) {\n const baseName = Path.basename(path)\n return baseName !== '.git' && baseName !== 'node_modules'\n}}).then(function(files) {\n console.log('files', result.files)\n console.log('directories', result.directories)\n})\n```\n\n## License\n\nThis project is licensed under the terms of MIT License. See the LICENSE file for more info.\n","readmeFilename":"README.md"}