# json-defiler

> Recursively merge files in a directory into a single json object.

Latest version **0.2.1** (published 2014-08-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install json-defiler
pnpm add json-defiler
yarn add json-defiler
bun add json-defiler
```

## 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.2.1 |
| Published | 2014-08-24 |
| First published | 2014-07-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Dennis Torres |
| Maintainers | psirenny |
| Keywords | directory, file, json, merge |

## Links

- npm: https://www.npmjs.com/package/json-defiler
- Repository: https://github.com/psirenny/node-json-defiler
- Issues: https://github.com/psirenny/node-json-defiler/issues
- npm.io page: https://npm.io/package/json-defiler

## Dependencies (2)

- [findit](https://npm.io/package/findit.md) ^2.0.0
- [traverse](https://npm.io/package/traverse.md) ^0.6.6

## 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.2.1 (latest) — 2014-08-24
- 0.2.0 — 2014-07-25
- 0.1.0 — 2014-07-11

## README

Json Defiler
============

Recursively merge files in a directory into a single json object.
Useful for breaking out config files into separate folders.

[![Build Status](https://travis-ci.org/psirenny/node-json-defiler.png?branch=master)](https://travis-ci.org/psirenny/node-json-defiler)

Installation
------------

    $ npm install json-defiler --save

Usage
-----

    var defiler = require('json-defiler');
    var json = defiler('/path/to/dir').json;

Files named `index.*` do not generate new keys in the json object.

Example
-------

Folder structure:

    root/
    +-- foo/
      +-- bar/
        +-- index.json
      +-- baz/
        +-- a.json
        +-- b.json
      +-- qux/
        +-- index.js

Defiler output:

    {
      "json": {
        "foo": {
          "bar": { /* index.json */ },
          "baz": {
            "a": { /* a.json */},
            "b": { /* b.json */ }
          },
          "qux": { /* index.js */ }
        }
      }
    }

Options
-------

**split** - If set to true, files will be separated by their extension.
Otherwise, all files will be merged into the returned `json` property.

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