# dat-walk

> Recursive directory walker for dat archives

Latest version **2.1.0** (published 2018-12-01) · Apache-2.0 license · 0 weekly downloads

## Install

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

## 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 | 2.1.0 |
| Published | 2018-12-01 |
| First published | 2018-11-20 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 15 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Brecht Savelkoul |
| Maintainers | savelbr |
| Keywords | file, directory, walker, dat, hyperdrive, scoped-fs |

## Links

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

## Dependencies (2)

- [callbox](https://npm.io/package/callbox.md) ^1.0.0
- [async-iterator-to-stream](https://npm.io/package/async-iterator-to-stream.md) ^1.0.3

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

- 2.1.0 (latest) — 2018-12-01
- 2.0.0 — 2018-12-01
- 1.1.0 — 2018-11-27
- 1.0.2 — 2018-11-22
- 1.0.1 — 2018-11-22
- 1.0.0 — 2018-11-20

## README

# dat-walk

Recursive directory walker for `dat` archives.

Supports both raw `hyperdrive` instances and Beaker Browser's `DatArchive` API.

## Usage

This package exports two modules. The default `require('dat-walk')` works with async iteration, whereas `require('dat-walk/stream')` uses standard Node streams. Both these examples log all file paths of a given `dat` to the console.

```js
// Async iteration
var walk = require('dat-walk')

async function main () {
  var dat = DatArchive.load(key)

  for await (var file of walk(dat)) {
    console.log(file)
  }
  console.log('done!')
}

main()

// Node stream
var hyperdrive = require('hyperdrive')
var walk = require('dat-walk/stream')

var dat = hyperdrive(key)
var stream = walk(dat, 'subdir')

stream.on('data', console.log)
stream.on('end', () => console.log('done!'))
```

## License

Apache-2.0

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