{"_id":"@1-/walk","_rev":"3-a44d19cae1dc3364e71e16009b347005","name":"@1-/walk","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"@1-/walk","version":"0.1.0","keywords":["walk","directory-traversal","concurrency-limit","fs-walk","readdir"],"author":{"name":"x-at-01@googlegroups.com"},"license":"MulanPSL-2.0","_id":"@1-/walk@0.1.0","maintainers":[{"name":"i18n-now","email":"i18n.site@gmail.com"}],"homepage":"https://github.com/webc-site/npm/tree/main/walk","bugs":{"url":"https://github.com/webc-site/npm/issues"},"dist":{"shasum":"7e0e4257b98a69afe6d1079bb7c8a4377165737a","tarball":"https://registry.npmjs.org/@1-/walk/-/walk-0.1.0.tgz","fileCount":8,"integrity":"sha512-Xpktd+mMrQBpycDIzW4zi1SgQz2rmRKJwx0KInrtEjps370HG81WPlxIq46qI1Qzk79Nl/cMxl0doObBbtaMfQ==","signatures":[{"sig":"MEYCIQCfshVWvigUQlM2kAJW/nZDByyip6bRTb+tWonfNnynMgIhANLZUHaXseN0WbpwPGWVXMPrXomZls9wtjMR+tdoCO2F","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8510},"type":"module","exports":{".":"./_.js","./*":"./*"},"_npmUser":{"name":"i18n-now","email":"i18n.site@gmail.com"},"repository":{"url":"git+https://github.com/webc-site/npm.git","type":"git"},"_npmVersion":"11.13.0","description":"Fast directory walker with concurrency limit and directory skipping | 并发受控且支持目录跳过的快速文件遍历工具","directories":{},"_nodeVersion":"26.2.0","dependencies":{"@3-/plimit":"^0.1.3"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/walk_0.1.0_1780936002926_0.7922465342989264","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@1-/walk","version":"0.1.1","keywords":["concurrency-limit","directory-traversal","fs-walk","readdir","walk"],"author":{"name":"x-at-01@googlegroups.com"},"license":"MulanPSL-2.0","_id":"@1-/walk@0.1.1","maintainers":[{"name":"i18n-now","email":"i18n.site@gmail.com"}],"homepage":"https://github.com/webc-site/npm/tree/main/walk","bugs":{"url":"https://github.com/webc-site/npm/issues"},"dist":{"shasum":"b0e8dbe59600f914b061069bf74efe31f43a934a","tarball":"https://registry.npmjs.org/@1-/walk/-/walk-0.1.1.tgz","fileCount":8,"integrity":"sha512-oRUuu/CmUxUhk9/xeAIGReshkVXaJw/sSwkjOL9rw6ODoLiE/b4hYSkyf+b6CxpCIrDcK+BVVtq6ASMeaqC6Rg==","signatures":[{"sig":"MEUCIHOy0rtJ5GiZDJOckCvB4TGaOVp2dyYpGhy8K0afOUqbAiEAssdFYfq3st5e3fqz7I0ia/BynlRc7eH9oroqCM9aFbE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8029},"type":"module","exports":{".":"./_.js","./*":"./*"},"_npmUser":{"name":"i18n-now","email":"i18n.site@gmail.com"},"repository":{"url":"git+https://github.com/webc-site/npm.git","type":"git"},"_npmVersion":"11.13.0","description":"Fast directory walker with concurrency limit and directory skipping | 并发受控且支持目录跳过的快速文件遍历工具","directories":{},"_nodeVersion":"26.2.0","dependencies":{"@3-/plimit":"^0.1.3"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/walk_0.1.1_1780980624303_0.341456650988895","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@1-/walk","version":"0.1.2","description":"Fast directory walker with concurrency limit and directory skipping | 并发受控且支持目录跳过的快速文件遍历工具","keywords":["concurrency-limit","directory-traversal","fs-walk","readdir","walk"],"homepage":"https://github.com/webc-site/npm/tree/main/walk","license":"MulanPSL-2.0","author":{"name":"x-at-01@googlegroups.com"},"repository":{"type":"git","url":"git+https://github.com/webc-site/npm.git"},"type":"module","exports":{".":"./_.js","./*":"./*"},"dependencies":{"@3-/plimit":"^0.1.3"},"_id":"@1-/walk@0.1.2","bugs":{"url":"https://github.com/webc-site/npm/issues"},"_nodeVersion":"26.2.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-OETfiF3b5iABGy8Pb0Zny63UYEq38HIArZSf4Q5wCNg3HWv4JSMNmaRBrXH/VTyjMJhyI3qOW9VhPmW/uOSIQA==","shasum":"b8a39385fcb74efeb3532be23558df17ec05a8ab","tarball":"https://registry.npmjs.org/@1-/walk/-/walk-0.1.2.tgz","fileCount":8,"unpackedSize":10274,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQD37IWxa/zGL9GDSMXFGW7hsH0mGvWVy78SFcpmeAa32gIgIbTSaVZ1nPUMI45J0xfXzCrQXDkteAYO0Szt70t2rAE="}]},"_npmUser":{"name":"i18n-now","email":"i18n.site@gmail.com"},"directories":{},"maintainers":[{"name":"i18n-now","email":"i18n.site@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/walk_0.1.2_1782926303715_0.23457166719129963"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-08T16:26:42.728Z","modified":"2026-07-01T17:18:24.050Z","0.1.0":"2026-06-08T16:26:43.097Z","0.1.1":"2026-06-09T04:50:24.438Z","0.1.2":"2026-07-01T17:18:23.926Z"},"bugs":{"url":"https://github.com/webc-site/npm/issues"},"author":{"name":"x-at-01@googlegroups.com"},"license":"MulanPSL-2.0","homepage":"https://github.com/webc-site/npm/tree/main/walk","keywords":["concurrency-limit","directory-traversal","fs-walk","readdir","walk"],"repository":{"type":"git","url":"git+https://github.com/webc-site/npm.git"},"description":"Fast directory walker with concurrency limit and directory skipping | 并发受控且支持目录跳过的快速文件遍历工具","maintainers":[{"name":"i18n-now","email":"i18n.site@gmail.com"}],"readme":"[English](#en) | [中文](#zh)\n\n---\n\n<a id=\"en\"></a>\n# @1-/walk : Concurrency-controlled directory traversal library with directory skipping\n\n- [@1-/walk : Concurrency-controlled directory traversal library with directory skipping](#1-walk-concurrency-controlled-directory-traversal-library-with-directory-skipping)\n  - [Features](#features)\n  - [Usage](#usage)\n    - [Installation](#installation)\n    - [Absolute Path Traversal (`walk`)](#absolute-path-traversal-walk)\n    - [Relative Path Traversal (`walkRel`)](#relative-path-traversal-walkrel)\n    - [Preconfigured Ignore Traversal (`walkRelIgnore`)](#preconfigured-ignore-traversal-walkrelignore)\n  - [Design Flow](#design-flow)\n  - [Tech Stack](#tech-stack)\n  - [Code Structure](#code-structure)\n  - [Historical Trivia](#historical-trivia)\n  - [About](#about)\n\nDirectory traversal library for Node.js and Bun with concurrency limit and directory skipping.\n\n## Features\n\n- **Concurrency Control**: Limits concurrent file system operations to prevent resource exhaustion. Default concurrency is system available parallelism (`availableParallelism()`).\n- **Directory Skipping**: Skips subdirectories dynamically when callbacks return `false`.\n- **Relative Path Resolution**: Resolves and outputs paths relative to the starting directory.\n- **Preconfigured Ignore**: `walkRelIgnore` provides preset filtering, automatically excluding `node_modules` directories and hidden files/directories (starting with `.`) based on basename.\n\n## Usage\n\n### Installation\n\n```bash\nnpm install @1-/walk\n# or\nbun add @1-/walk\n```\n\n### Absolute Path Traversal (`walk`)\n\n```javascript\nimport walk, { DIR, FILE } from \"@1-/walk\";\n\nawait walk(\n  \"/path/to/dir\",\n  async (kind, path) => {\n    if (kind === DIR && path.endsWith(\"/temp\")) {\n      return false; // Skip traversing this directory\n    }\n    console.log(kind === FILE ? \"File:\" : \"Dir:\", path);\n  },\n  4, // Optional: concurrency limit, defaults to availableParallelism()\n); // Concurrency limit of 4\n```\n\n### Relative Path Traversal (`walkRel`)\n\n```javascript\nimport walkRel from \"@1-/walk/walkRel.js\";\n\nawait walkRel(\"/path/to/dir\", async (kind, relPath) => {\n  console.log(relPath);\n}, 4); // Optional: concurrency limit\n```\n\n### Preconfigured Ignore Traversal (`walkRelIgnore`)\n\nAutomatically excludes `node_modules` directories and hidden files/directories (starting with `.`).\n\n```javascript\nimport walkRelIgnore from \"@1-/walk/walkRelIgnore.js\";\n\nawait walkRelIgnore(\"/path/to/dir\", async (kind, relPath) => {\n  console.log(relPath);\n}, 4); // Optional: concurrency limit\n```\n\n## Design Flow\n\nThe system coordinates module calls, concurrency control, and recursive checks.\n\n![](https://fastly.jsdelivr.net/gh/webc-fs/-@Wj/WPlpaFYrodU2Rl10nTkg.svg)\n\n## Tech Stack\n\n- Runtime: Node.js / Bun\n- Dependencies: `@3-/plimit`\n- Standard libraries: `node:fs/promises`, `node:path`, `node:os`\n\n## Code Structure\n\n```\n.\n├── src/\n│   ├── _.js               # Core walk implementation\n│   ├── walkRel.js         # Relative path wrapper\n│   └── walkRelIgnore.js   # Preconfigured ignore wrapper\n├── test/\n│   └── _.test.js          # Unit test\n└── package.json\n```\n\n## Historical Trivia\n\nIn 1974, Dick Haight at AT&T Bell Laboratories designed the `find` command for Version 5 Unix. As hierarchical file systems grew, recursive directory traversal became essential infrastructure for operating systems.\n\nWith modern application scales, file system operations risk resource limit exhaustion such as file descriptor limits. `@1-/walk` adopts Unix traversal design, utilizing modern JavaScript asynchronous concurrency mechanisms to achieve fast and safe traversal under resource control.\n## About\n\nThis library is developed by [WebC.site](https://webc.site).\n\n[WebC.site](https://webc.site): A new paradigm of web development for AI\n\n\n---\n\n<a id=\"zh\"></a>\n# @1-/walk : 并发受控且支持目录跳过的快速文件遍历工具\n\n- [@1-/walk : 并发受控且支持目录跳过的快速文件遍历工具](#1-walk-并发受控且支持目录跳过的快速文件遍历工具)\n  - [功能介绍](#功能介绍)\n  - [使用演示](#使用演示)\n    - [安装](#安装)\n    - [绝对路径遍历 (`walk`)](#绝对路径遍历-walk)\n    - [相对路径遍历 (`walkRel`)](#相对路径遍历-walkrel)\n    - [预设忽略遍历 (`walkRelIgnore`)](#预设忽略遍历-walkrelignore)\n  - [设计思路](#设计思路)\n  - [技术栈](#技术栈)\n  - [代码结构](#代码结构)\n  - [历史故事](#历史故事)\n  - [关于](#关于)\n\n提供并发限制、目录跳过及路径过滤功能的文件系统遍历库。\n\n## 功能介绍\n\n- **并发控制**：限制文件系统并发操作数，防止资源耗尽。默认并发数为系统可用并行度（`availableParallelism()`）。\n- **目录跳过**：回调函数返回 `false` 时跳过子目录递归遍历。\n- **相对路径**：支持解析并输出相对于起始目录的相对路径。\n- **预设忽略**：`walkRelIgnore` 提供预设过滤，自动排除 `node_modules` 目录及以 `.` 开头的隐藏文件与目录（基于 basename 判断）。\n\n## 使用演示\n\n### 安装\n\n```bash\nnpm install @1-/walk\n# 或\nbun add @1-/walk\n```\n\n### 绝对路径遍历 (`walk`)\n\n```javascript\nimport walk, { DIR, FILE } from \"@1-/walk\";\n\nawait walk(\n  \"/path/to/dir\",\n  async (kind, path) => {\n    if (kind === DIR && path.endsWith(\"/temp\")) {\n      return false; // 跳过此目录的递归\n    }\n    console.log(kind === FILE ? \"File:\" : \"Dir:\", path);\n  },\n  4, // 可选：并发限制，默认为 availableParallelism()\n); // 并发限制为 4\n```\n\n### 相对路径遍历 (`walkRel`)\n\n```javascript\nimport walkRel from \"@1-/walk/walkRel.js\";\n\nawait walkRel(\"/path/to/dir\", async (kind, relPath) => {\n  console.log(relPath);\n}, 4); // 可选：并发限制\n```\n\n### 预设忽略遍历 (`walkRelIgnore`)\n\n自动过滤 `node_modules` 目录与隐藏文件（以 `.` 开头）。\n\n```javascript\nimport walkRelIgnore from \"@1-/walk/walkRelIgnore.js\";\n\nawait walkRelIgnore(\"/path/to/dir\", async (kind, relPath) => {\n  console.log(relPath);\n}, 4); // 可选：并发限制\n```\n\n## 设计思路\n\n相关模块的调用流程如下：\n\n![](https://fastly.jsdelivr.net/gh/webc-fs/-@1Z/ojiPHyyIHbyYd-3suu0w.svg)\n\n## 技术栈\n\n- 运行时：Node.js / Bun\n- 核心依赖：`@3-/plimit`\n- 标准库：`node:fs/promises`, `node:path`, `node:os`\n\n## 代码结构\n\n```\n.\n├── src/\n│   ├── _.js               # 核心 walk 实现\n│   ├── walkRel.js         # 相对路径封装\n│   └── walkRelIgnore.js   # 预设忽略封装\n├── test/\n│   └── _.test.js          # 单元测试\n└── package.json\n```\n\n## 历史故事\n\n1974年，AT&T 贝尔实验室的 Dick Haight 为 Version 5 Unix 引入 `find` 命令。随着分层文件系统普及，递归目录遍历成为操作系统重要基础设施。\n\n现代应用规模增长，文件系统操作容易遇到文件描述符耗尽等瓶颈。`@1-/walk` 继承 Unix 目录遍历思想，通过现代 JavaScript 异步并发机制（Promise 与并发限制器），控制系统资源并进行遍历。\n## 关于\n\n本库由 [WebC.site](https://webc.site) 开发。\n\n[WebC.site](https://webc.site) : 面向人工智能的网站开发新范式\n\n","readmeFilename":"README.md"}