# walker

> A simple directory tree walker.

Latest version **1.0.8** (published 2021-10-23) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install walker
pnpm add walker
yarn add walker
bun add walker
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.8 |
| Published | 2021-10-23 |
| First published | 2011-02-25 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 105 |
| Author | Naitik Shah |
| Maintainers | daaku |
| Keywords | utils, fs, filesystem |

## Links

- npm: https://www.npmjs.com/package/walker
- Repository: https://github.com/daaku/nodejs-walker
- Issues: https://github.com/daaku/nodejs-walker/issues
- npm.io page: https://npm.io/package/walker

## Dependencies (1)

- [makeerror](https://npm.io/package/makeerror.md) 1.0.12

## 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

- 1.0.8 (latest) — 2021-10-23
- 1.0.7 — 2015-05-21
- 1.0.6 — 2014-04-06
- 1.0.5 — 2013-10-09
- 1.0.3 — 2011-08-17
- 1.0.2 — 2011-07-27
- 1.0.1 — 2011-07-24
- 1.0.0 — 2011-07-24
- 0.0.4 — 2011-04-18
- 0.0.1 — 2011-02-25
- 0.0.3 — 2011-02-25

## README

walker [![Build Status](https://secure.travis-ci.org/daaku/nodejs-walker.png)](http://travis-ci.org/daaku/nodejs-walker)
======

A nodejs directory walker. Broadcasts events for various file types as well as
a generic "entry" event for all types and provides the ability to prune
directory trees. This shows the entire API; everything is optional:

```javascript
Walker('/etc/')
  .filterDir(function(dir, stat) {
    if (dir === '/etc/pam.d') {
      console.warn('Skipping /etc/pam.d and children')
      return false
    }
    return true
  })
  .on('entry', function(entry, stat) {
    console.log('Got entry: ' + entry)
  })
  .on('dir', function(dir, stat) {
    console.log('Got directory: ' + dir)
  })
  .on('file', function(file, stat) {
    console.log('Got file: ' + file)
  })
  .on('symlink', function(symlink, stat) {
    console.log('Got symlink: ' + symlink)
  })
  .on('blockDevice', function(blockDevice, stat) {
    console.log('Got blockDevice: ' + blockDevice)
  })
  .on('fifo', function(fifo, stat) {
    console.log('Got fifo: ' + fifo)
  })
  .on('socket', function(socket, stat) {
    console.log('Got socket: ' + socket)
  })
  .on('characterDevice', function(characterDevice, stat) {
    console.log('Got characterDevice: ' + characterDevice)
  })
  .on('error', function(er, entry, stat) {
    console.log('Got error ' + er + ' on entry ' + entry)
  })
  .on('end', function() {
    console.log('All files traversed.')
  })
```

You specify a root directory to walk and optionally specify a function to prune
sub-directory trees via the `filterDir` function. The Walker exposes a number
of events, broadcasting various file type events a generic error event and
finally the event to signal the end of the process.

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