{"id":16351601,"url":"https://github.com/tomeraberbach/get-all-files","last_synced_at":"2025-03-16T15:31:55.189Z","repository":{"id":45230315,"uuid":"137126601","full_name":"TomerAberbach/get-all-files","owner":"TomerAberbach","description":"⚡ A blazing fast recursive directory crawler with lazy sync and async iterator support.","archived":false,"fork":false,"pushed_at":"2024-06-23T02:54:29.000Z","size":387,"stargazers_count":16,"open_issues_count":0,"forks_count":4,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-10-12T01:23:29.964Z","etag":null,"topics":["async-iterator-support","benchmark","directory","file-tree","files","fs","iterates","javascript","micromatch","node-js","node-module","nodejs","npm","npm-module","npm-package","path","paths","readdir","recursive"],"latest_commit_sha":null,"homepage":"https://npm.im/get-all-files","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/TomerAberbach.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}},"created_at":"2018-06-12T20:53:39.000Z","updated_at":"2024-06-23T02:54:33.000Z","dependencies_parsed_at":"2024-06-18T18:14:05.301Z","dependency_job_id":"c56bcf28-0342-40df-866d-3299d9dda506","html_url":"https://github.com/TomerAberbach/get-all-files","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomerAberbach%2Fget-all-files","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomerAberbach%2Fget-all-files/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomerAberbach%2Fget-all-files/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomerAberbach%2Fget-all-files/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TomerAberbach","download_url":"https://codeload.github.com/TomerAberbach/get-all-files/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221665471,"owners_count":16860258,"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":["async-iterator-support","benchmark","directory","file-tree","files","fs","iterates","javascript","micromatch","node-js","node-module","nodejs","npm","npm-module","npm-package","path","paths","readdir","recursive"],"created_at":"2024-10-11T01:23:20.862Z","updated_at":"2024-10-27T10:50:43.481Z","avatar_url":"https://github.com/TomerAberbach.png","language":"TypeScript","funding_links":["https://github.com/sponsors/TomerAberbach"],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  get-all-files\n\u003c/h1\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://npmjs.org/package/get-all-files\"\u003e\n    \u003cimg src=\"https://badgen.net/npm/v/get-all-files\" alt=\"version\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/TomerAberbach/get-all-files/actions\"\u003e\n    \u003cimg src=\"https://github.com/TomerAberbach/get-all-files/actions/workflows/ci.yml/badge.svg\" alt=\"CI\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/sponsors/TomerAberbach\"\u003e\n    \u003cimg src=\"https://img.shields.io/static/v1?label=Sponsor\u0026message=%E2%9D%A4\u0026logo=GitHub\u0026color=%23fe8e86\" alt=\"Sponsor\"\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n  A blazing fast recursive directory crawler with lazy sync and async iterator support.\n\u003c/div\u003e\n\n## Install\n\n```sh\n$ npm i get-all-files\n```\n\n## Usage\n\n```js\nimport { getAllFiles, getAllFilesSync } from 'get-all-files'\n\n// Lazily iterate over filenames asynchronously\nfor await (const filename of getAllFiles(`path/to/dir/or/file`)) {\n  // Could break early on some condition and get-all-files\n  // won't have unnecessarily accumulated the filenames in an array\n  console.log(filename)\n}\n\n// Get array of filenames asynchronously\nconsole.log(await getAllFiles(`path/to/dir/or/file`).toArray())\n\n// Lazily iterate over filenames synchronously\nfor (const filename of getAllFilesSync(`path/to/dir/or/file`)) {\n  // Could break early on some condition and get-all-files\n  // won't have unnecessarily accumulated the filenames in an array\n  console.log(filename)\n}\n\n// Get array of filenames synchronously\nconsole.log(getAllFilesSync(`path/to/dir/or/file`).toArray())\n```\n\n## API\n\n### Methods\n\n#### `getAllFiles(path[, options])`\n\nReturns a lazy\n[async iterable/iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/asyncIterator)\nthat asynchronously iterates over the file paths recursively found at `path` in\nno particular order.\n\nCalling `toArray` on the returned value returns a promise that resolves to an\narray of the file paths.\n\n#### `getAllFilesSync(path[, options])`\n\nReturns a lazy\n[iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol)/[iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterator_protocol)\nthat iterates over the file paths recursively found at `path` in no particular\norder.\n\nCalling `toArray` on the returned value returns an array of the file paths.\n\n### Parameters\n\n#### `path`\n\nType: `string`\n\nA path to a file or directory to recursively find files in.\n\n#### `options`\n\nType: `object`\n\n##### Properties\n\n###### `resolve`\n\nType: `boolean`\\\nDefault: `false`\n\nWhether to resolve paths to absolute paths (relative to `process.cwd()`).\n\n###### `isExcludedDir`\n\nType: `(dirname: string) =\u003e boolean`\\\nDefault: `() =\u003e false`\n\nA predicate that determines whether the directory with the given `dirname`\nshould be crawled. There is no `isExcludedFile` option because you can exclude\nfiles by checking conditions while lazily iterating using`getAllFiles.sync` or\n`getAllFiles.async`.\n\n## Contributing\n\nStars are always welcome!\n\nFor bugs and feature requests,\n[please create an issue](https://github.com/TomerAberbach/get-all-files/issues/new).\n\n## License\n\n[MIT](https://github.com/TomerAberbach/get-all-files/blob/main/license) ©\n[Tomer Aberbach](https://github.com/TomerAberbach)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomeraberbach%2Fget-all-files","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomeraberbach%2Fget-all-files","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomeraberbach%2Fget-all-files/lists"}