{"id":21945289,"url":"https://github.com/52cik/node-walkdir","last_synced_at":"2025-07-15T14:19:24.181Z","repository":{"id":65424777,"uuid":"69368985","full_name":"52cik/node-walkdir","owner":"52cik","description":"node traversal files (async/sync)","archived":false,"fork":false,"pushed_at":"2018-02-03T16:47:36.000Z","size":10,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T22:08:36.521Z","etag":null,"topics":["walkdir"],"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/52cik.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":"2016-09-27T15:05:33.000Z","updated_at":"2022-02-06T16:57:04.000Z","dependencies_parsed_at":"2023-01-23T02:05:11.429Z","dependency_job_id":null,"html_url":"https://github.com/52cik/node-walkdir","commit_stats":{"total_commits":17,"total_committers":2,"mean_commits":8.5,"dds":0.05882352941176472,"last_synced_commit":"8cbefa5bea85581cf387ed2ecffddd255ffaa1aa"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/52cik%2Fnode-walkdir","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/52cik%2Fnode-walkdir/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/52cik%2Fnode-walkdir/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/52cik%2Fnode-walkdir/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/52cik","download_url":"https://codeload.github.com/52cik/node-walkdir/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250326193,"owners_count":21412218,"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":["walkdir"],"created_at":"2024-11-29T04:18:10.479Z","updated_at":"2025-04-22T21:24:41.699Z","avatar_url":"https://github.com/52cik.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node-walkdir\n\n\u003e node traversal files (async/sync)\n\n[![Linux Build][travis-image]][travis-url]\n[![Coverage Status][coveralls-image]][coveralls-url]\n[![Dependencies][dependencies-image]][dependencies-url]\n[![node][node-image]][node-url]\n[![license MIT][license-image]][license-url]\n\n[中文文档](README.zh-CN.md)\n\n## Requirements\n\n\u003e node8 or higher\n\n## How to use it\n\n### Installation\n\n```sh\n$ yarn add node-walkdir\n# or\n$ npm install node-walkdir\n```\n\n### Examples\n\n```js\nconst walkdir = require('node-walkdir')\n\n/** async */\n(async() =\u003e {\n  // walk all files by default\n  const allFiles = await walk('you-path');\n  console.log('files:', allFiles);\n\n  // only traverse the JS files\n  const jsFiles = await walk('you-path', '.js');\n  console.log('files:', jsFiles);\n\n  // traverse the JS and JSON files\n  const jsonFiles = await walk('you-path', ['.js', '.json']);\n  console.log('files:', jsonFiles);\n\n  // traverse the JS and JSON files by regexp\n  const json2Files = await walk('you-path', /\\.js(on)?$/);\n  console.log('files:', json2Files);\n\n  // only traverse the JS files with 2 level directories deep.\n  const js2Files = await walk('you-path', '.js', 2);\n  console.log('files:', js2Files);\n})();\n\n/** sync */\n// walk all files by default\nconst allFiles = walk.sync('you-path');\nconsole.log('files:', allFiles);\n\n// only traverse the JS files\nconst jsFiles = walk.sync('you-path', '.js');\nconsole.log('files:', jsFiles);\n\n// traverse the JS and JSON files\nconst jsonFiles = walk.sync('you-path', ['.js', '.json']);\nconsole.log('files:', jsonFiles);\n\n// traverse the JS and JSON files by regexp\nconst json2Files = walk.sync('you-path', /\\.js(on)?$/);\nconsole.log('files:', json2Files);\n\n// only traverse the JS files with 2 level directories deep.\nconst js2Files = walk.sync('you-path', '.js', 2);\nconsole.log('files:', js2Files);\n```\n\n\n[travis-url]: https://travis-ci.org/52cik/node-walkdir\n[travis-image]: https://img.shields.io/travis/52cik/node-walkdir/master.svg?label=linux\n\n[coveralls-url]: https://coveralls.io/github/52cik/node-walkdir?branch=master\n[coveralls-image]: https://coveralls.io/repos/52cik/node-walkdir/badge.svg?branch=master\u0026service=github\n\n[license-url]: https://opensource.org/licenses/MIT\n[license-image]: https://img.shields.io/badge/license-MIT-blue.svg\n\n[dependencies-url]: https://david-dm.org/52cik/node-walkdir\n[dependencies-image]: https://img.shields.io/david/52cik/node-walkdir.svg?style=flat\n\n[node-url]: https://nodejs.org\n[node-image]: https://img.shields.io/badge/node-%3E=%208-brightgreen.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F52cik%2Fnode-walkdir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F52cik%2Fnode-walkdir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F52cik%2Fnode-walkdir/lists"}