{"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":"2.7.4","type":"module","main":"dist/index.js","exports":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"clean":"tsex clean","compile":"tsex compile","compile:watch":"tsex compile --watch","test":"tsex test","test:watch":"tsex test --watch","prepublishOnly":"tsex prepare"},"keywords":["readdir","recursive","promise","simple","tiny"],"dependencies":{"promise-make-counter":"^1.0.2"},"devDependencies":{"@types/node":"^18.19.70","fava":"^0.3.4","tsex":"^4.0.2","typescript":"^5.7.3"},"_id":"tiny-readdir@2.7.4","gitHead":"3ede82e173867ac14a66b6b68df4385f37ce7f06","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-721U+zsYwDirjr8IM6jqpesD/McpZooeFi3Zc6mcjy1pse2C+v19eHPFRqz4chGXZFw7C3KITDjAtHETc2wj7Q==","shasum":"9bda667835fd9b27802f1bc0ea45ab15acdcd307","tarball":"http://registry-npm.ywwl.com/tiny-readdir/download/tiny-readdir-2.7.4.tgz","fileCount":11,"unpackedSize":13722,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHxpZxbhmcKyFRWCC1HqeV9dcz2lbYcNaNZgmGOV0Co1AiAjXG+qZhr6fKALTRpDWKKfKpN+SCwPxLDLCNLKV0t5TA=="}],"size":4115,"noattachment":false,"key":"/tiny-readdir/-/tiny-readdir-2.7.4.tgz"},"_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/tiny-readdir_2.7.4_1736634470734_0.23377193732548518"},"_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 => /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 reactive read after 10s\n\nsetTimeout ( () => aborter.abort (), 10_000 ); // Aborting if it's going to take longer than 10s\n\n// This is the basic information we'll get\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// This is more advanced information we'll get, which is useful in some cases\n\nresult.directoriesNames; // => Set of directories names found\nresult.filesNames; // => Set of files name found\nresult.symlinksNames; // => Set of symlinks names found\n\nresult.directoriesNamesToPaths; // => Record of directories names found to their paths\nresult.filesNamesToPaths; // => Record of files names found to their paths\nresult.symlinksNamesToPaths; // => Record of symlinks names found to their paths\n```\n\n## License\n\nMIT © Fabio Spampinato\n","publish_time":1736634470935,"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"_cnpm_publish_time":1736634470935,"dist-tags":{"latest":"3.1.1"}}