{"name":"tiny-readdir-glob","version":"1.23.2","keywords":["readdir","recursive","promise","simple","tiny","glob"],"_id":"tiny-readdir-glob@1.23.2","maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"homepage":"https://github.com/fabiospampinato/tiny-readdir-glob#readme","bugs":{"url":"https://github.com/fabiospampinato/tiny-readdir-glob/issues"},"dist":{"shasum":"c0f38a017bc4704f06de2dcd336187008735151f","tarball":"http://registry-npm.ywwl.com/tiny-readdir-glob/download/tiny-readdir-glob-1.23.2.tgz","fileCount":15,"integrity":"sha512-+47FIdgzEtZj03mOyq9iAljlZZNleqSEwe3i6Uzkzec5axbMg32Vp78U2fLo4TiCMv9gzjnno7yJn34z5pXECw==","signatures":[{"sig":"MEUCIQD34+Ztb9chNogy7iPzjhiqKgGkupbO/aeea7cnrchu5AIgDHP0FI91QNIKPmbD4ejYT2ogxBeOXm8bYw4jz6mXsIQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34796,"size":7541,"noattachment":false,"key":"/tiny-readdir-glob/-/tiny-readdir-glob-1.23.2.tgz"},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","exports":"./dist/index.js","gitHead":"095f7d49b79efe3f053cf3fd12237f9a25ecb919","scripts":{"test":"tsex test","clean":"tsex clean","compile":"tsex compile","test:watch":"tsex test --watch","compile:watch":"tsex compile --watch","prepublishOnly":"tsex prepare"},"_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"repository":{"url":"git+https://github.com/fabiospampinato/tiny-readdir-glob.git","type":"git"},"_npmVersion":"10.5.0","description":"A simple promisified recursive readdir function, with support for globs.","directories":{},"_nodeVersion":"18.20.2","dependencies":{"zeptomatch":"^2.0.1","tiny-readdir":"^2.7.0","zeptomatch-explode":"^1.0.1","zeptomatch-unescape":"^1.0.1","zeptomatch-is-static":"^1.0.1"},"_hasShrinkwrap":false,"devDependencies":{"fava":"^0.3.1","tsex":"^3.0.1","typescript":"^5.3.2","@types/node":"^20.9.4"},"_npmOperationalInternal":{"tmp":"tmp/tiny-readdir-glob_1.23.2_1745324143094_0.6796000508640185","host":"s3://npm-registry-packages-npm-production"},"readme":"# Tiny Readdir Glob\n\nA simple promisified recursive readdir function, with support for globs.\n\nGlobs are expressed in [`zeptomatch`](https://github.com/fabiospampinato/zeptomatch)'s flavor.\n\n## Install\n\n```sh\nnpm install tiny-readdir-glob\n```\n\n## Usage\n\n```ts\nimport readdir from 'tiny-readdir-glob';\n\n// Let's recursively read into a directory using a glob\n\nconst aborter = new AbortController ();\nconst result = await readdir ( ['src/**/*.js'], {\n  cwd: process.cwd (), // Directory to start the search from, defaults to process.cwd()\n  depth: 20, // Maximum depth to look at\n  limit: 1_000_000, // Maximum number of files explored, useful as a stop gap in some edge cases\n  followSymlinks: true, // Whether to follow symlinks or not\n  ignore: ['**/.git', '**/node_modules'], // Globs, or raw function, that if returns true will ignore this particular file or a directory and its descendants\n  signal: aborter.signal, // Optional abort signal, useful for aborting potentially expensive operations\n  onDirents: dirents => console.log ( dirents ) // Optional callback that will be called as soon as new dirents are available, useful for example for discovering \".gitignore\" files while searching\n});\n\n// This is how we would abort the recursive read after 10s\n\nsetTimeout ( () => aborter.abort (), 10_000 ); // Aborting if it's going to take longer than 10s\n\n// This is what the result object will look like\n\nresult.directories; // => Array of absolute paths pointing to directories, filtered by the provided glob\nresult.files; // => Array of absolute paths pointing to files, filtered by the provided glob\nresult.symlinks; // => Array of absolute paths pointing to symlinks, filtered by the provided glob\n```\n\n## License\n\nMIT © Fabio Spampinato\n","publish_time":1745324143281,"_cnpm_publish_time":1745324143281,"dist-tags":{"latest":"2.0.0"}}