{"id":22356336,"url":"https://github.com/do-/node-dir-list","last_synced_at":"2026-02-04T00:02:22.186Z","repository":{"id":250563100,"uuid":"834794225","full_name":"do-/node-dir-list","owner":"do-","description":"Iterating over file paths in a given set of directories, lambda filters ","archived":false,"fork":false,"pushed_at":"2024-07-28T13:57:23.000Z","size":47,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-25T06:32:23.088Z","etag":null,"topics":["fs","iterator"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/do-.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":"2024-07-28T11:37:11.000Z","updated_at":"2024-07-28T13:57:26.000Z","dependencies_parsed_at":"2024-07-28T14:00:29.432Z","dependency_job_id":"98f7d070-d579-4f85-a955-1f66b9536b5d","html_url":"https://github.com/do-/node-dir-list","commit_stats":null,"previous_names":["do-/node-dir-list"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/do-/node-dir-list","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/do-%2Fnode-dir-list","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/do-%2Fnode-dir-list/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/do-%2Fnode-dir-list/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/do-%2Fnode-dir-list/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/do-","download_url":"https://codeload.github.com/do-/node-dir-list/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/do-%2Fnode-dir-list/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29062483,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T23:14:54.203Z","status":"ssl_error","status_checked_at":"2026-02-03T23:14:50.873Z","response_time":96,"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":["fs","iterator"],"created_at":"2024-12-04T14:09:56.234Z","updated_at":"2026-02-04T00:02:22.164Z","avatar_url":"https://github.com/do-.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![workflow](https://github.com/do-/node-dir-list/actions/workflows/main.yml/badge.svg)\n![Jest coverage](./badges/coverage-jest%20coverage.svg)\n\n`fs-iterators` is a zero dependency node.js library implementing [file system](https://nodejs.org/api/fs.html) [iterators](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) over given sets or root paths with functions as filtering conditions.\n\nIt features two classes: \n* [DirList](https://github.com/do-/node-dir-list/wiki/DirList), the directory tree iterator;\n* [FilePaths](https://github.com/do-/node-dir-list/wiki/FilePaths), the files iterator.\n\n# Installation\n```sh\nnpm install fs-iterators\n```\n\n# Usage\n```js\nconst {DirList} = require ('fs-iterators')\n\nconst myDir = new DirList ({\n  root: ['/opt/myProject'], \n  filter: (str, arr) =\u003e \n    /src/.test (str)            // contains 'src'\n    \u0026\u0026 arr.at (-2) === 'Model', // **/Model/*\n// live: true,                  // avoid caching, scan every time\n})\n\nfor (const dir of myDir.paths) console.log ({dir})\n\nfor (const file of myDir.files ()) console.log ({file})\nfor (const file of myDir.files ('index.js')) console.log ({file})\nfor (const file of myDir.files (_ =\u003e /js$/.test (_))) console.log ({file})\n```\n\n# See also\n* [fs-iterator](https://www.npmjs.com/package/fs-iterator) seems to solve a pretty similar problem, with some restrictions (e. g. a single root path instead of multiple ones);\n* [filelist](https://www.npmjs.com/package/filelist) is a much more popular solution, but it implements the complete [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) interface instead of only Iterator and uses masks (globs) instead of functional filters.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdo-%2Fnode-dir-list","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdo-%2Fnode-dir-list","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdo-%2Fnode-dir-list/lists"}