{"id":13825751,"url":"https://github.com/bcomnes/async-folder-walker","last_synced_at":"2026-04-05T11:31:13.857Z","repository":{"id":36309036,"uuid":"223294839","full_name":"bcomnes/async-folder-walker","owner":"bcomnes","description":"A recursive async iterator of the files and directories in a given directory. Can take multiple directories and files, limit walk depth and filter based on path names and stat results.","archived":false,"fork":false,"pushed_at":"2025-12-10T22:57:00.000Z","size":127,"stargazers_count":19,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-11T10:38:36.911Z","etag":null,"topics":["dir","esm","folder-walker","fs","nodejs"],"latest_commit_sha":null,"homepage":"https://npmjs.com/async-folder-walker","language":"JavaScript","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/bcomnes.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/funding.yml","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["bcomnes"],"custom":["https://bret.io"]}},"created_at":"2019-11-22T01:04:46.000Z","updated_at":"2025-12-10T22:57:02.000Z","dependencies_parsed_at":"2023-10-01T18:28:50.960Z","dependency_job_id":"8c664bab-0d5b-4bf0-b753-266a69001ea7","html_url":"https://github.com/bcomnes/async-folder-walker","commit_stats":{"total_commits":71,"total_committers":3,"mean_commits":"23.666666666666668","dds":"0.46478873239436624","last_synced_commit":"740f31596753de649c9219ffc3e89dc81a619778"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/bcomnes/async-folder-walker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcomnes%2Fasync-folder-walker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcomnes%2Fasync-folder-walker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcomnes%2Fasync-folder-walker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcomnes%2Fasync-folder-walker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bcomnes","download_url":"https://codeload.github.com/bcomnes/async-folder-walker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcomnes%2Fasync-folder-walker/sbom","scorecard":{"id":228706,"data":{"date":"2025-08-11","repo":{"name":"github.com/bcomnes/async-folder-walker","commit":"324dd8e031e74ad1c65e94b9e6069c5efb49aec6"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/15 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: jobLevel 'contents' permission set to 'write': .github/workflows/tests.yml:31","Warn: no topLevel permission defined: .github/workflows/release.yml:1","Warn: no topLevel permission defined: .github/workflows/tests.yml:1"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/bcomnes/async-folder-walker/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/bcomnes/async-folder-walker/release.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/bcomnes/async-folder-walker/release.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/tests.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/bcomnes/async-folder-walker/tests.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/bcomnes/async-folder-walker/tests.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/bcomnes/async-folder-walker/tests.yml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/release.yml:29","Warn: npmCommand not pinned by hash: .github/workflows/tests.yml:24","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned","Info:   0 out of   2 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 15 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T04:23:06.711Z","repository_id":36309036,"created_at":"2025-08-17T04:23:06.711Z","updated_at":"2025-08-17T04:23:06.711Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31434624,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T08:13:15.228Z","status":"ssl_error","status_checked_at":"2026-04-05T08:13:11.839Z","response_time":75,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["dir","esm","folder-walker","fs","nodejs"],"created_at":"2024-08-04T09:01:26.428Z","updated_at":"2026-04-05T11:31:13.834Z","avatar_url":"https://github.com/bcomnes.png","language":"JavaScript","funding_links":["https://github.com/sponsors/bcomnes","https://bret.io"],"categories":["JavaScript"],"sub_categories":[],"readme":"# async-folder-walker\n[![Actions Status](https://github.com/bcomnes/async-folder-walker/workflows/tests/badge.svg)](https://github.com/bcomnes/async-folder-walker/actions)\n\nA recursive async iterator of the files and directories in a given folder. Can take multiple folders, limit walk depth and filter based on path names and stat results.\n\n![](https://repository-images.githubusercontent.com/223294839/43cf9600-0d3f-11ea-858e-81b08a14509f)\n\n## Installation\n\n```\nnpm install async-folder-walker\n```\n\n## Usage\n\n``` js\nconst { asyncFolderWalker, allFiles } = require('async-folder-walker')\n\nasync function iterateFiles () {\n  const walker = asyncFolderWalker(['.git', 'node_modules'])\n  for await (const file of walker) {\n    console.log(file) // logs the file path!\n  }\n}\n\nasync function getAllFiles () {\n  const allFilepaths = await allFiles(['.git', 'node_modules'])\n  console.log(allFilepaths)\n}\n\niterateFiles().then(() =\u003e getAllFiles())\n```\n\n## API\n\n### `const { asyncFolderWalker, allFiles } = require('async-folder-walker')`\n\nImport `asyncFolderWalker` or `allFiles`.\n\n### `async-gen = asyncFolderWalker(paths, [opts])`\n\nReturn an async generator that will iterate over all of files inside of a directory. `paths` can be a string path or an Array of string paths.\n\nYou can iterate over each file and directory individually using a `for-await...of` loop.  Note, you must be inside an [async function statement](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function).\n\n```js\nconst { asyncFolderWalker } = require('async-folder-walker')\nasync function iterateFiles () {\n  const walker = asyncFolderWalker(['.git', 'node_modules'])\n  for await (const file of walker) {\n    console.log(file) // logs the file path!\n  }\n}\n\niterateFiles()\n```\n\nOpts include:\n\n```js\n{\n  fs: require('fs'),\n  pathFilter: filepath =\u003e true,\n  statFilter st =\u003e true,\n  ignore: [],\n  maxDepth: Infinity,\n  shaper: ({ root, filepath, stat, relname, basename }) =\u003e filepath\n}\n```\n\nThe `pathFilter` function allows you to filter files from additional async stat operations.  Return false to filter the file.\n\n```js\n{ // exclude node_modules\n  pathFilter: filepath =\u003e !filepath.includes(node_modules)\n}\n```\n\nThe `statFilter` function allows you to filter files based on the internal stat operation.  Return false to filter the file.\n\n```js\n{ // exclude all directories:\n  statFilter: st =\u003e !st.isDirectory()\n}\n```\n\nThe `ignore` option can be a string or or array of strings that should follow gitignore style ignore strings. Files and directories that match are ignored.\n\n```js\n{ // Ignore node_modules at any depth and any file starting with a .\n  ['node_modules', '.*']\n}\n```\n\nThe `shaper` function lets you change the shape of the returned value based on data accumulaed during the iteration.  To return the same shape as [okdistribute/folder-walker](https://github.com/okdistribute/folder-walker) use the following function:\n\n```js\n{ // Return the same shape as folder-walker\n  shaper: fwData =\u003e fwData\n}\n````\n\nExample of a fwData object for a directory:\n\n```js\n{\n  root: '/Users/bret/repos/async-folder-walker/fixtures',\n  filepath: '/Users/bret/repos/async-folder-walker/fixtures/sub-folder/sub-sub-folder',\n  stat: Stats {\n    dev: 16777220,\n    mode: 16877,\n    nlink: 3,\n    uid: 501,\n    gid: 20,\n    rdev: 0,\n    blksize: 4096,\n    ino: 30244023,\n    size: 96,\n    blocks: 0,\n    atimeMs: 1574381262779.8396,\n    mtimeMs: 1574380914743.5474,\n    ctimeMs: 1574380914743.5474,\n    birthtimeMs: 1574380905232.5996,\n    atime: 2019-11-22T00:07:42.780Z,\n    mtime: 2019-11-22T00:01:54.744Z,\n    ctime: 2019-11-22T00:01:54.744Z,\n    birthtime: 2019-11-22T00:01:45.233Z\n  },\n  relname: 'sub-folder/sub-sub-folder',\n  basename: 'sub-sub-folder'\n}\n```\n\nand another example for a file on windows:\n\n```js\n{\n  root: 'D:\\\\a\\\\async-folder-walker\\\\async-folder-walker\\\\fixtures',\n  filepath: 'D:\\\\a\\\\async-folder-walker\\\\async-folder-walker\\\\fixtures\\\\sub-folder\\\\sub-sub-folder\\\\sub-sub-folder-file.json',\n  stat: Stats {\n    dev: 1321874112,\n    mode: 33206,\n    nlink: 1,\n    uid: 0,\n    gid: 0,\n    rdev: 0,\n    blksize: 4096,\n    ino: 562949953421580,\n    size: 37,\n    blocks: 0,\n    atimeMs: 1577476819530.035,\n    mtimeMs: 1577476819530.035,\n    ctimeMs: 1577476819530.035,\n    birthtimeMs: 1577476819530.035,\n    atime: 2019-12-27T20:00:19.530Z,\n    mtime: 2019-12-27T20:00:19.530Z,\n    ctime: 2019-12-27T20:00:19.530Z,\n    birthtime: 2019-12-27T20:00:19.530Z\n  },\n  relname: 'sub-folder\\\\sub-sub-folder\\\\sub-sub-folder-file.json',\n  basename: 'sub-sub-folder-file.json'\n}\n```\n\nThe `stat` property is an instance of [fs.Stats](https://nodejs.org/api/fs.html#fs_class_fs_stats) so it has extra methods not listed here.\n\n### `files = await allFiles(paths, [opts])`\n\nGet an Array of all files inside of a directory.  `paths` can be a single string path or an array of string paths.\n\n`opts` Is the same as [`asyncFolderWalker`](#async-gen--asyncfolderwalkerpaths-opts).\n\n## See also\n\nThis module is effectivly a rewrite of [okdistribute/folder-walker](https://github.com/okdistribute/folder-walker) using async generators instead of Node streams, and a few tweaks to the underlying options to make the results a bit more flexible.\n\n- [for-await...of](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcomnes%2Fasync-folder-walker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbcomnes%2Fasync-folder-walker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcomnes%2Fasync-folder-walker/lists"}