# parse-dir

> Node lib to recursively read the files in a directory and return their contents

Latest version **4.0.2** (published 2021-02-19) · MIT license · 0 weekly downloads

## Install

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

## 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 | 4.0.2 |
| Published | 2021-02-19 |
| First published | 2014-06-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 23.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | First+Third |
| Maintainers | jga, dawnerd, ecwillis, orthagonal1, alaguna, aleperez92 |

## Links

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

## Dependencies (3)

- [glob](https://npm.io/package/glob.md) ^7.1.4
- [async](https://npm.io/package/async.md) ^3.0.1
- [js-yaml](https://npm.io/package/js-yaml.md) ^3.13.1

## Recent versions

- 4.0.2 (latest) — 2021-02-19
- 4.0.1 — 2019-06-10
- 4.0.0 — 2017-11-17
- 3.0.0 — 2017-10-25
- 2.0.0 — 2017-02-07
- 1.0.0 — 2017-01-24
- 0.1.0 — 2016-02-15
- 0.0.2 — 2014-07-26
- 0.0.1 — 2014-06-02

## README

parse-dir
[![Build Status](https://travis-ci.org/firstandthird/parse-dir.svg?branch=master)](https://travis-ci.org/firstandthird/parse-dir)

=========

[![Greenkeeper badge](https://badges.greenkeeper.io/firstandthird/parse-dir.svg)](https://greenkeeper.io/)

Node lib to recursively read the files in a directory and return their contents.

## Installation

```npm install parse-dir```

## Usage

```parseDir(glob, callback);```

Or, if you prefer to make it synchronous:

```javascript
var result = parseDir(glob);
var otherResult = parseDir.sync(otherGlob);
```

### Example

```javascript
var parseDir = require('parse-dir');

parseDir('*', function(err, files) {

});
```

### Output

```javascript
[
  {
    fullpath: '/path/to/file.ext',
    filename: 'file.ext',
    basename: 'file',
    extension: '.ext',
    raw: 'raw contents of file',
    contents: 'parsed contents of file',
    parsed: true|false //if file is supported, it will parse the contents.  If false, contents == raw.  See Parsing Files.
  }
]
```

## Parsing Files

If `parseDir` knows how to parse a file, it will attempt to read it and turn it into a javascript object.

### Supported Files

* YAML
* JSON
* JS
* CoffeeScript
* Livescript

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