{"id":18777284,"url":"https://github.com/iyowei/ls-dir","last_synced_at":"2026-05-16T18:03:48.966Z","repository":{"id":57119757,"uuid":"438933467","full_name":"iyowei/ls-dir","owner":"iyowei","description":"并行扫描文件夹。","archived":false,"fork":false,"pushed_at":"2021-12-18T07:44:22.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-08T18:12:56.383Z","etag":null,"topics":["dir","fs","iyowei","nodejs","walker"],"latest_commit_sha":null,"homepage":"","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/iyowei.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}},"created_at":"2021-12-16T09:33:49.000Z","updated_at":"2021-12-31T07:54:15.000Z","dependencies_parsed_at":"2022-08-23T15:40:54.717Z","dependency_job_id":null,"html_url":"https://github.com/iyowei/ls-dir","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/iyowei/ls-dir","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iyowei%2Fls-dir","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iyowei%2Fls-dir/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iyowei%2Fls-dir/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iyowei%2Fls-dir/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iyowei","download_url":"https://codeload.github.com/iyowei/ls-dir/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iyowei%2Fls-dir/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273318670,"owners_count":25084248,"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","status":"online","status_checked_at":"2025-09-02T02:00:09.530Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","fs","iyowei","nodejs","walker"],"created_at":"2024-11-07T20:09:35.226Z","updated_at":"2026-05-16T18:03:48.938Z","avatar_url":"https://github.com/iyowei.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[node version badge]: https://img.shields.io/badge/node.js-%3E%3D12.20.0-brightgreen?style=flat\u0026logo=Node.js\n[download node.js]: https://nodejs.org/en/download/\n[prs welcome badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat\n[lsdirsync]: https://github.com/iyowei/ls-dir-sync\n[lsdir]: https://github.com/iyowei/ls-dir\n[scandireachsync]: https://github.com/iyowei/scan-dir-sync\n[scandireach]: https://github.com/iyowei/scan-dir-each\n[scandirsync]: https://github.com/iyowei/scan-dir-sync\n[scandir]: https://github.com/iyowei/scan-dir\n\n# lsDir(path)\n\n\u003e 并行扫描文件夹。\n\n## 使用\n\n- `path` 待扫描的路径，**必需提供**，{String}\n- 返回，扫描结果 { `Promise\u003cArray\u003e` }\n\n```js\nimport { log } from \"console\";\nimport lsDir from \"@iyowei/ls-dir\";\n\n(async () =\u003e {\n  log(await lsDir(process.cwd()));\n\n  /**\n   * [\n   *   {\n   *     path: '',\n   *     dirent: [Dirent]\n   *   },\n   *   ...\n   * ]\n   */\n})();\n```\n\n## 安装\n\n[![Node Version Badge][node version badge]][download node.js]\n\n```shell\n# Pnpm\npnpm add @iyowei/ls-dir\n\n# yarn\nyarn add @iyowei/ls-dir\n\n# npm\nnpm add @iyowei/ls-dir\n```\n\n## 相关\n\n- [**`lsDirSync()`**][lsdirsync]，串行扫描文件夹；\n- [**`scanDirEachSync()`**][scandireachsync]，可在扫描的同时更新或过滤数据，**串行** 实现；\n- [**`scanDirEach()`**][scandireach]，可在扫描的同时更新或过滤数据，**并行** 实现；\n- [**`scanDirSync()`**][scanDirSync]，`worker` 选填，有 `worker`，行为同 `scanDirEachSync()` 一致，否则与 `lsDirSync()` 一致，如果项目中同时使用了 `scanDirEachSync()`、`lsDirSync()`，则推荐使用 `scanDirSync()`；\n- [**`scanDir()`**][scandir]，`worker` 选填，有 `worker`，行为同 `scanDirEach()` 一致，否则与 `lsDir()` 一致，如果项目中同时使用了 `scanDirEach()`、`lsDir()`，则推荐使用 `scanDir()`；\n\n## 参与贡献\n\n![PRs Welcome][prs welcome badge]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiyowei%2Fls-dir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiyowei%2Fls-dir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiyowei%2Fls-dir/lists"}