{"name":"tiny-readdir","repository":{"type":"git","url":"git+https://github.com/fabiospampinato/tiny-readdir.git"},"description":"A simple promisified recursive readdir function.","version":"2.6.0","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-naked":"^2.1.1"},"devDependencies":{"@types/node":"^20.4.8","fava":"^0.2.1","tsex":"^3.0.1","typescript":"^5.1.6"},"_id":"tiny-readdir@2.6.0","gitHead":"bf19805c8aea5ff2a645422252548a4c8fae4e05","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-muWmRy0Vigpu5XphasHH0cCqZExpfHlk5JIgvUYvELKELEkjkbg5uTxQWQFLgobJkK3/7duW8Q/TTQsenmV6xQ==","shasum":"03587bc6b4b5d0851986db6cdf95527c850a3d11","tarball":"http://registry-npm.ywwl.com/tiny-readdir/download/tiny-readdir-2.6.0.tgz","fileCount":18,"unpackedSize":33174,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZUu59D8A4OHPkk2jJT/Hzq6K3lBfJEGCc4V4Cwc48jQIgVep2hYxI2ZcNNKzMpYYSXwIZvkluLFqQyrtGIIQnUlQ="}],"size":6567,"noattachment":false,"key":"/tiny-readdir/-/tiny-readdir-2.6.0.tgz"},"_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"directories":{},"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tiny-readdir_2.6.0_1710805327462_0.30512193317335745"},"_hasShrinkwrap":false,"readme":"# Tiny Readdir\n\nA simple promisified recursive readdir function.\n\n## Install\n\n```sh\nnpm install --save tiny-readdir\n```\n\n## Usage\n\n```ts\nimport readdir from 'tiny-readdir';\n\nconst aborter = new AbortController ();\n\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\nconsole.log ( result.directories ); // => Array of absolute paths pointing to directories\nconsole.log ( result.files ); // => Array of absolute paths pointing to files\nconsole.log ( result.symlinks ); // => Array of absolute paths pointing to symlinks\n\nconsole.log ( result.directoriesNames ); // => Set of directories names found\nconsole.log ( result.filesNames ); // => Set of files name found\nconsole.log ( result.symlinksNames ); // => Set of symlinks names found\n\nconsole.log ( result.directoriesNamesToPaths ); // => Record of directories names found to their paths\nconsole.log ( result.filesNamesToPaths ); // => Record of files names found to their paths\nconsole.log ( result.symlinksNamesToPaths ); // => Record of symlinks names found to their paths\n\nsetTimeout ( () => aborter.abort (), 10000 ); // Aborting if it's going to take longer than 10s\n```\n\n## License\n\nMIT © Fabio Spampinato\n","publish_time":1710805327789,"_cnpm_publish_time":1710805327789,"dist-tags":{"latest":"3.1.1"}}