# gulp-json-tree

> Convert a buffer of files into a JSON representation of the directory structure with contents.

Latest version **0.1.0** (published 2015-07-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install gulp-json-tree
pnpm add gulp-json-tree
yarn add gulp-json-tree
bun add gulp-json-tree
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2015-07-02 |
| First published | 2015-07-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.8.0 |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Michael Jaworski |
| Maintainers | jaworskm |
| Keywords | gulpplugin, json, directory, files, gulp |

## Links

- npm: https://www.npmjs.com/package/gulp-json-tree
- Repository: https://github.com/advisory/gulp-json-tree
- Homepage: https://github.com/advisory/gulp-json-tree#readme
- Issues: https://github.com/advisory/gulp-json-tree/issues
- npm.io page: https://npm.io/package/gulp-json-tree

## Dependencies (3)

- [through2](https://npm.io/package/through2.md) ^1.1.1
- [gulp-util](https://npm.io/package/gulp-util.md) ~3.0.3
- [lodash.isempty](https://npm.io/package/lodash.isempty.md) ^3.0.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.1.0 (latest) — 2015-07-02

## README

# gulp-directory-map
[![NPM version][npm-image]][npm-url] [![Dependency Status][depstat-image]][depstat-url] 

> Convert a buffer of files into a JSON representation of the directory structure with contents using [gulp](https://github.com/gulpjs/gulp)

## Usage

First, install `gulp-json-tree` as a development dependency:

```shell
npm install --save-dev gulp-json-tree
```

Then, add it to your `gulpfile.js`:

```javascript
var jsonTree = require("gulp-json-tree");
  
gulp.src('app/**/*.json')
  .pipe(jsonTree({
    filename: 'urls.json'
  }))
  .pipe(gulp.dest('dist'));

```

Given this directory structure...
```
app
  |_nested-folder-1
    |_nested-folder-1-1
      |_index.json
    |_faq.json
    |_index.json
  |_nested-folder-2
    |_nested-folder-2-1
      |_index.json
    |_index.json
  |_index.json
```

... this JSON object would be written to `dist/urls.json`:

```json
{
  "index.html": { ... },
  "nested-folder-1": {
    "faq.html": { ... },
    "index.html": { ... },
    "nested-folder-1-1": {
      "index.html": { ... }
    }
  },
  "nested-folder-2": {
    "index.html": { ... }
  }
}
```

This is useful for mapping out a directory structure after passing files through a pre-processor, generating data to create navigation during build, and more.

## API

### directory-map(options)

#### options.filename
Type: `String`  
Default: `urls.json`

The path to write the directory structure JSON file to.

## License

[MIT License](http://en.wikipedia.org/wiki/MIT_License)


[npm-url]: https://npmjs.org/package/gulp-directory-map
[npm-image]: https://badge.fury.io/js/gulp-directory-map.png

[travis-url]: http://travis-ci.org/masondesu/gulp-directory-map
[travis-image]: https://secure.travis-ci.org/masondesu/gulp-directory-map.png?branch=master

[coveralls-url]: https://coveralls.io/r/masondesu/gulp-directory-map
[coveralls-image]: https://coveralls.io/repos/masondesu/gulp-directory-map/badge.png

[depstat-url]: https://david-dm.org/masondesu/gulp-directory-map
[depstat-image]: https://david-dm.org/masondesu/gulp-directory-map.png
[depstat-dev-url]: https://david-dm.org/masondesu/gulp-directory-map#info=devDependencies
[depstat-dev-image]: https://david-dm.org/masondesu/gulp-directory-map/dev-status.png

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