# dir-each

> higher order function for iterating over files

Latest version **0.3.6** (published 2013-11-23) · 0 weekly downloads

## Install

```sh
npm install dir-each
pnpm add dir-each
yarn add dir-each
bun add dir-each
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.6 |
| Published | 2013-11-23 |
| First published | 2013-06-02 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Jake Rosoman |
| Maintainers | jkroso |
| Keywords | each, walk, file, iterate |

## Links

- npm: https://www.npmjs.com/package/dir-each
- Repository: https://github.com/jkroso/dir-each
- Issues: https://github.com/jkroso/dir-each/issues
- npm.io page: https://npm.io/package/dir-each

## Dependencies (4)

- [result](https://npm.io/package/result.md) ~0.4.4
- [foreach](https://npm.io/package/foreach.md) jkroso/forEach#0.8.8
- [lift-result](https://npm.io/package/lift-result.md) ~0.1.3
- [result-type](https://npm.io/package/result-type.md) 1.0.0

## 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.3.6 (latest) — 2013-11-23
- 0.3.5 — 2013-09-09
- 0.3.4 — 2013-07-17
- 0.3.3 — 2013-06-27
- 0.3.2 — 2013-06-27
- 0.3.1 — 2013-06-24
- 0.3.0 — 2013-06-23
- 0.2.0 — 2013-06-04
- 0.1.2 — 2013-06-04
- 0.1.1 — 2013-06-03
- 0.1.0 — 2013-06-02

## README

# dir-each

  higher order functions for iterating over files

## Installation

_With npm_  

	$ npm install dir-each --save

then in your app:

```js
var each = require('dir-each')
var series = require('dir-each/series')
```

## API

  - [each()](#each)
  - [series()](#series)

both functions also come in variations which include symlinked files. To access them use `fn.withSyms`

### each(dir:String, fn:Function)

  iterate over each file in `dir` and apply `fn`. `each` fully understands the semantics of [Results](//github.com/jkroso/result) so you can pass them as arguments and return them from `fn` with the desired effect.

```js
var files = 0
each(process.env.HOME, function(path){
  console.log(path)
  files++
}).read(function(){
  console.log('you own %d files', files)
})
```

### series(dir:String, fn:Function)

  as above but waits on results between iterations

## Running the tests

```bash
$ npm install
$ make test
```

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