# dat-glob

> Glob implementation for dat archives

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

## Install

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

## 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.3.0 |
| Published | 2018-12-01 |
| First published | 2018-11-21 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 16.7 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Brecht Savelkoul |
| Maintainers | savelbr |
| Keywords | glob, pattern, file, matcher, match, dat, hyperdrive, scoped-fs |

## Links

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

## Dependencies (7)

- [callbox](https://npm.io/package/callbox.md) ^1.0.0
- [pumpify](https://npm.io/package/pumpify.md) ^1.5.1
- [dat-walk](https://npm.io/package/dat-walk.md) ^2.1.0
- [through2](https://npm.io/package/through2.md) ^3.0.0
- [micromatch](https://npm.io/package/micromatch.md) ^3.1.10
- [glob-parent](https://npm.io/package/glob-parent.md) ^3.1.0
- [call-me-maybe](https://npm.io/package/call-me-maybe.md) ^1.0.1

## 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.3.0 (latest) — 2018-12-01
- 1.2.1 — 2018-12-01
- 1.2.0 — 2018-11-27
- 1.1.0 — 2018-11-23
- 1.0.2 — 2018-11-22
- 1.0.1 — 2018-11-22
- 1.0.0 — 2018-11-21

## README

# dat-glob

Glob implementation for `dat` archives.

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

## Usage

This package exports two modules. The default `require('dat-glob')` works with async iteration, whereas `require('dat-glob/stream')` uses standard Node streams. Both modules include a `collect` method which returns a list of all matching files.

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

async function main () {
  var dat = await DatArchive.create()

  for await (var file of glob(dat, '**/*.json')) {
    console.log(file) // 'dat.json'
  }

  var files = await glob(dat, '**/*.json').collect()
  console.log(files) // ['dat.json']
}

main()

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

var dat = hyperdrive(key)
var stream = glob(dat, ['*.json', 'subdir/*.json'])

stream.pipe(process.stdout)

stream.collect((err, files) => {
  console.log(files)
})
```

## License

Apache-2.0

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