# merge-object-files

> Merges objects in files into a single object.

Latest version **2.0.0** (published 2018-05-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install merge-object-files
pnpm add merge-object-files
yarn add merge-object-files
bun add merge-object-files
```

## 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 | 2.0.0 |
| Published | 2018-05-01 |
| First published | 2016-06-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 8.0.0 |
| Dependencies | 0 |
| Unpacked size | 4.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Trevor Livingston |
| Maintainers | tlivings |

## Links

- npm: https://www.npmjs.com/package/merge-object-files
- Repository: https://github.com/tlivings/merge-object-files
- Homepage: https://github.com/tlivings/merge-object-files#readme
- Issues: http://github.com/tlivings/merge-object-files/issues
- npm.io page: https://npm.io/package/merge-object-files

## Recent versions

- 2.0.0 (latest) — 2018-05-01
- 1.0.3 — 2016-06-27
- 1.0.2 — 2016-06-26
- 1.0.1 — 2016-06-26
- 1.0.0 — 2016-06-26

## README

# merge-object-files

Merges a directory containing json or other files exporting objects and merges them into a single object.

Sub directories and files become keys under the merged objects, with file contents becoming values.

Requires Node 6.

### api

`merge-object-files` exposes a single method.

- `merge(dirname, extensions, \*optional*\ callback)` - merges the given `dirname`.

Arguments:

- `dirname` - the directory to merge - defaults to caller's directory.
- `extensions` - an array of extensions to accept - defaults to `['json']`.
- `callback` - if omitted, a promise is returned.

### usage

```js
const Files = require('merge-object-files');
const Path = require('path');

Files.merge(Path.resolve(__dirname, 'objects'), ['json', 'js'])
.then((merged) => {
    //...
})
.catch((error) => {
    console.error(error.stack);
});
```

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