# read-up

> Read multiple files with a given filename and aggregate the results

Latest version **1.0.1** (published 2017-04-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install read-up
pnpm add read-up
yarn add read-up
bun add read-up
```

## 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.1 |
| Published | 2017-04-25 |
| First published | 2017-04-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Ben Drucker |
| Maintainers | bendrucker |
| Keywords | read, up, files, aggregate, file, directory |

## Links

- npm: https://www.npmjs.com/package/read-up
- Repository: https://github.com/bendrucker/read-up
- Homepage: https://github.com/bendrucker/read-up#readme
- Issues: https://github.com/bendrucker/read-up/issues
- npm.io page: https://npm.io/package/read-up

## Dependencies (3)

- [ap](https://npm.io/package/ap.md) ~0.2.0
- [cast-array](https://npm.io/package/cast-array.md) ~1.0.1
- [run-parallel](https://npm.io/package/run-parallel.md) ~1.1.6

## 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.1 (latest) — 2017-04-25
- 1.0.0 — 2017-04-24

## README

# read-up [![Build Status](https://travis-ci.org/bendrucker/read-up.svg?branch=master)](https://travis-ci.org/bendrucker/read-up)

> Read multiple files with a given filename and aggregate the results


## Install

```
$ npm install --save read-up
```


## Usage

```js
var readUp = require('read-up')

readUp('data.txt', function (err, data) {
  console.log(data[0])
  // === cat './a/b/c/data.txt'  
})
```

```
# File tree
.
├── a
│   ├── b
│   │   ├── c
│   │   │   └── data.txt
│   │   ├── data-alternate.txt
│   │   ├── data.txt
│   │   └── ignored.txt
│   └── data.txt
└── data.txt
```

## API

#### `readUp(filenames, [options], callback)` -> `undefined`

Reads upwards looking for `filenames` in each directory. Results are returned in the order they were read, so the deepest files come first.

##### filenames

*Required*  
Type: `array[string]` / `string`

One or more filenames to search for in each directory.

##### options

###### cwd

Type: `string`  
Default: `process.cwd()`

The directory where traversal will begin.

###### root

Type: `string`  
Default: `/`

The directory where traversal will end.

##### callback

*Required*  
Type: `function`  
Arguments: `err, results`

A callback that will be called with an error or an array of `Buffer` objects representing file data. `results` are ordered by read-time.

## License

MIT © [Ben Drucker](http://bendrucker.me)

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