{"name":"tiny-readdir-glob","repository":{"type":"git","url":"git+https://github.com/fabiospampinato/tiny-readdir-glob.git"},"description":"A simple promisified recursive readdir function, with support for globs.","version":"1.0.2","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","glob"],"dependencies":{"tiny-readdir":"^2.2.0","zeptomatch":"^1.1.3"},"devDependencies":{"@types/node":"^20.9.4","fava":"^0.3.1","tsex":"^3.0.1","typescript":"^5.3.2"},"gitHead":"6ed5c52be93b49b17996be7d348c53f963052663","bugs":{"url":"https://github.com/fabiospampinato/tiny-readdir-glob/issues"},"homepage":"https://github.com/fabiospampinato/tiny-readdir-glob#readme","_id":"tiny-readdir-glob@1.0.2","_nodeVersion":"18.12.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-FnNtWj7ZgWgsWrLSk4hSaDmvjwDhjbfbVrhhwdyJ6z96th1HLpDTmUwsY+LrSN7iEEKcXTcB8+Ujl4XT3YaQig==","shasum":"4ffc1ee6a2d53705ccd11852976b961d4f9fcc3e","tarball":"http://registry-npm.ywwl.com/tiny-readdir-glob/download/tiny-readdir-glob-1.0.2.tgz","fileCount":16,"unpackedSize":29202,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFWhZUE5+H8sSBr8AgY2p7z+pAGFJvpCWMdMQnMWxu26AiEAhWLCia5XSP1geW4cdG38ZcejIBSM/HPJvsYAKT+TsnU="}],"size":6898,"noattachment":false,"key":"/tiny-readdir-glob/-/tiny-readdir-glob-1.0.2.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-glob_1.0.2_1701198578557_0.9838106396954931"},"_hasShrinkwrap":false,"readme":"# Tiny Readdir Glob\n\nA simple promisified recursive readdir function, with support for globs.\n\n## Install\n\n```sh\nnpm install --save tiny-readdir-glob\n```\n\n## Usage\n\n```ts\nimport readdir from 'tiny-readdir-glob';\n\nconst aborter = new AbortController ();\n\nconst result = await readdir ( ['src/**/*.js'], {\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\nconsole.log ( result.directories ); // => Array of absolute paths pointing to directories, filtered by the provided glob\nconsole.log ( result.files ); // => Array of absolute paths pointing to files, filtered by the provided glob\nconsole.log ( result.symlinks ); // => Array of absolute paths pointing to symlinks, filtered by the provided glob\n\nconsole.log ( result.directoriesFound ); // => Array of absolute paths pointing to directories, not fully filtered by the provided glob yet\nconsole.log ( result.filesFound ); // => Array of absolute paths pointing to files, not fully filtered by the provided glob yet\nconsole.log ( result.symlinksFound ); // => Array of absolute paths pointing to symlinks, not fully filtered by the provided glob yet\n\nconsole.log ( result.directoriesFoundNames ); // => Set of directories names found\nconsole.log ( result.filesFoundNames ); // => Set of files name found\nconsole.log ( result.symlinksFoundNames ); // => Set of symlinks names found\n\nconsole.log ( result.directoriesFoundNamesToPaths ); // => Record of directories names found to their paths\nconsole.log ( result.filesFoundNamesToPaths ); // => Record of files name found to their paths\nconsole.log ( result.symlinksFoundNamesToPaths ); // => 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":1701198578875,"_cnpm_publish_time":1701198578875,"dist-tags":{"latest":"2.0.0"}}