{"name":"tiny-readdir","repository":{"type":"git","url":"git+https://github.com/fabiospampinato/tiny-readdir.git"},"description":"A simple promisified recursive readdir function.","license":"MIT","version":"3.1.1","type":"module","main":"dist/index.js","exports":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"benchmark":"tsex benchmark","benchmark:watch":"tsex benchmark --watch","benchmark:prepare":"cd tasks && git clone https://github.com/babel/babel.git","clean":"tsex clean","compile":"tsex compile","compile:watch":"tsex compile --watch","test":"tsex test","test:watch":"tsex test --watch","prepublishOnly":"npm run compile && node test/index.js"},"keywords":["readdir","recursive","promise","simple","tiny"],"dependencies":{"promise-make-counter":"^1.0.2"},"devDependencies":{"@types/node":"^18.19.130","benchloop":"^2.1.1","fava":"^0.3.5","tsex":"^4.0.2","typescript":"^5.9.3"},"_id":"tiny-readdir@3.1.1","gitHead":"a120ae1226871882c680fa2aff0c0b9505c13998","bugs":{"url":"https://github.com/fabiospampinato/tiny-readdir/issues"},"homepage":"https://github.com/fabiospampinato/tiny-readdir#readme","_nodeVersion":"18.19.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-SiNW3Kp5xshlA3McA2C/tjU7K8+VJc9ZNe09foB8ut8lMY7bR9NKPo5ARHDOj24mV69/utNy8gqDjF93FcFlFg==","shasum":"389efc52e79c2de5f381fac220e77a4bf951cf89","tarball":"http://registry-npm.ywwl.com/tiny-readdir/download/tiny-readdir-3.1.1.tgz","fileCount":11,"unpackedSize":10524,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQD6XqQU9hllPdMephfNlxtsJ5ol0Z3JFcyWwx8bCZrNyAIgGSaexxY1Xov6zwIuFYtad3g1MEsRPcEBureZyWKDePE="}],"size":3713,"noattachment":false,"key":"/tiny-readdir/-/tiny-readdir-3.1.1.tgz"},"_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"directories":{},"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/tiny-readdir_3.1.1_1771775365399_0.6505324286929752"},"_hasShrinkwrap":false,"readme":"# Tiny Readdir\n\nA simple promisified recursive readdir function.\n\n## Install\n\n```sh\nnpm install tiny-readdir\n```\n\n## Usage\n\n```ts\nimport readdir from 'tiny-readdir';\n\n// Let's recursively read into a directory\n\nconst aborter = new AbortController ();\nconst result = await readdir ( '/foo/bar', {\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: ( targetPath, targetContext ) => /node_modules/.test ( targetPath ), // 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\nresult.files; // => Array of absolute paths pointing to files\nresult.symlinks; // => Array of absolute paths pointing to symlinks\n```\n\n## License\n\nMIT © Fabio Spampinato\n","publish_time":1771775365534,"_cnpm_publish_time":1771775365534,"dist-tags":{"latest":"3.1.1"}}