2.0.4 • Published 10 months ago

@0xdd/fs-walk v2.0.4

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
10 months ago

fs-walk

A generator-based lightweight memory efficient recursive directory walk for Node.js.

Installation

npm: npm install @0xdd/fs-walk

yarn: yarn add @0xdd/fs-walk

pnpm: pnpm add @0xdd/fs-walk

Usage

import { walk, walkSync } from '@0xdd/fs-walk';

(async () => {
  for await (const i of walk('.')) {
    console.log(i);
  }
})();

for (const i of walkSync('.', { skip: [/node_modules/, /\.git/] })) {
  console.log(i.path);
}

Motivation

fs.readdir does not do recursive traversal of directory tree. The solutions available online sometimes fail to work on large directories due to recursion limits.

License

Apache-2.0

Attribution

Documentation and interface for walk were adapted from Go Copyright 2009 The Go Authors. All rights reserved. BSD license.

TypeScript interface inspired by Deno Copyright 2018-2021 the Deno authors.

2.0.3

10 months ago

2.0.2

10 months ago

2.0.4

10 months ago

2.0.1

1 year ago

2.0.0

3 years ago

1.2.8

3 years ago

1.2.7

3 years ago

1.2.6

4 years ago

1.2.5

4 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.1

4 years ago

1.1.2

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago