# fs-walk

> Synchronous and asynchronous recursive directory listing for node

Latest version **0.0.2** (published 2018-02-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install fs-walk
pnpm add fs-walk
yarn add fs-walk
bun add fs-walk
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2018-02-26 |
| First published | 2013-07-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 11.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 19 |
| Author | Alberto Gonzalez |
| Maintainers | bjarnicc, cc-alberto, svanderburg, yiannisosc |
| Keywords | list, walk, directory, fs |

## Links

- npm: https://www.npmjs.com/package/fs-walk
- Repository: https://github.com/confcompass/fs-walk
- Homepage: https://github.com/confcompass/fs-walk#readme
- Issues: https://github.com/confcompass/fs-walk/issues
- npm.io page: https://npm.io/package/fs-walk

## Dependencies (1)

- [async](https://npm.io/package/async.md) *

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 0.0.2 (latest) — 2018-02-26
- 0.0.1 — 2013-07-28

## README

fs-walk
=======

Synchronous and asynchronous recursive directory walking for node. Uses callbacks to mimic the API of the `fs` module.

## Usage

To asynchronously walk the `/etc` directory, and for example, change the file and directory permissions, do:

```js
var walk = require('fs-walk');

walk.walk('/etc', function(basedir, filename, stat, next) {
	var perm = stat.isDirectory() ? 0755 : 0644;
    fs.chmod(path.join(basedir, filename), perm, next);
}, function(err) {
    if (err) console.log(err);
});
```

You can achieve the same result, synchronously:

```js
var walk = require('fs-walk');

walk.walkSync('/etc', function(basedir, filename, stat) {
	var perm = stat.isDirectory() ? 0755 : 0644;
    fs.chmodSync(path.join(basedir, filename), perm, next);
});
```

Two convenience functions are provided for convenience, `walk.files` and `walk.dirs` (and their synchronous counterparts) to walk through files and directories.

```js
var walk = require('fs-walk');

walk.files('/etc', function(basedir, filename, stat, next) {
	fs.chmod(path.join(basedir, filename), 0644, next);
}, function(err) {
    if (err) console.log(err);
});

walk.dirs('/etc', function(basedir, filename, stat, next) {
	fs.chmod(path.join(basedir, filename), 0755, next);
}, function(err) {
    if (err) console.log(err);
});
```


## License

(The MIT License)

Copyright (c) 2013 Conference Compass BV 

Maintainer:
Alberto Gonzalez <alberto@conference-compass.com>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

---
_Source: https://npm.io/package/fs-walk · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
