{"id":22221997,"url":"https://github.com/fabiospampinato/tiny-readdir-glob","last_synced_at":"2025-04-09T08:10:07.094Z","repository":{"id":208909851,"uuid":"722777604","full_name":"fabiospampinato/tiny-readdir-glob","owner":"fabiospampinato","description":"A simple promisified recursive readdir function, with support for globs.","archived":false,"fork":false,"pushed_at":"2025-02-10T01:26:15.000Z","size":50,"stargazers_count":28,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T06:08:06.625Z","etag":null,"topics":["glob","promise","readdir","recursive","simple","tiny"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fabiospampinato.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"fabiospampinato","custom":"https://www.paypal.me/fabiospampinato"}},"created_at":"2023-11-23T23:40:51.000Z","updated_at":"2025-03-24T22:26:01.000Z","dependencies_parsed_at":"2023-12-15T03:42:32.799Z","dependency_job_id":"2c84c0b1-aff0-4524-9a84-2589077f4bdc","html_url":"https://github.com/fabiospampinato/tiny-readdir-glob","commit_stats":null,"previous_names":["fabiospampinato/tiny-readdir-glob"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Ftiny-readdir-glob","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Ftiny-readdir-glob/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Ftiny-readdir-glob/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Ftiny-readdir-glob/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fabiospampinato","download_url":"https://codeload.github.com/fabiospampinato/tiny-readdir-glob/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247999861,"owners_count":21031046,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["glob","promise","readdir","recursive","simple","tiny"],"created_at":"2024-12-02T23:16:29.551Z","updated_at":"2025-04-09T08:10:07.071Z","avatar_url":"https://github.com/fabiospampinato.png","language":"TypeScript","funding_links":["https://github.com/sponsors/fabiospampinato","https://www.paypal.me/fabiospampinato"],"categories":[],"sub_categories":[],"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\n// Let's recursively read into a directory using a glob\n\nconst aborter = new AbortController ();\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 =\u003e 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 the basic information we'll get\n\nresult.directories; // =\u003e Array of absolute paths pointing to directories, filtered by the provided glob\nresult.files; // =\u003e Array of absolute paths pointing to files, filtered by the provided glob\nresult.symlinks; // =\u003e Array of absolute paths pointing to symlinks, filtered by the provided glob\n\n// This is more advanced information we'll get, which is useful in some cases\n\nresult.directoriesFound; // =\u003e Array of absolute paths pointing to directories, not fully filtered by the provided glob yet\nresult.filesFound; // =\u003e Array of absolute paths pointing to files, not fully filtered by the provided glob yet\nresult.symlinksFound; // =\u003e Array of absolute paths pointing to symlinks, not fully filtered by the provided glob yet\n\nresult.directoriesFoundNames; // =\u003e Set of directories names found\nresult.filesFoundNames; // =\u003e Set of files name found\nresult.symlinksFoundNames; // =\u003e Set of symlinks names found\n\nresult.directoriesFoundNamesToPaths; // =\u003e Record of directories names found to their paths\nresult.filesFoundNamesToPaths; // =\u003e Record of files name found to their paths\nresult.symlinksFoundNamesToPaths; // =\u003e Record of symlinks names found to their paths\n\nsetTimeout ( () =\u003e aborter.abort (), 10000 ); // Aborting if it's going to take longer than 10s\n```\n\n## License\n\nMIT © Fabio Spampinato\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabiospampinato%2Ftiny-readdir-glob","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffabiospampinato%2Ftiny-readdir-glob","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabiospampinato%2Ftiny-readdir-glob/lists"}