https://github.com/jayin/jsonmerge
jsonmerge *.json > result.json
https://github.com/jayin/jsonmerge
Last synced: 4 months ago
JSON representation
jsonmerge *.json > result.json
- Host: GitHub
- URL: https://github.com/jayin/jsonmerge
- Owner: Jayin
- License: apache-2.0
- Created: 2016-02-10T06:37:06.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-01-22T09:12:17.000Z (over 1 year ago)
- Last Synced: 2025-03-05T14:18:19.806Z (4 months ago)
- Language: JavaScript
- Size: 37.1 KB
- Stars: 4
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jsonmerge [](https://www.npmjs.com/package/jsonmerge) [](https://www.npmjs.com/package/jsonmerge) [](https://github.com/Jayin/jsonmerge/actions/workflows/unit-test.yml) [](https://github.com/Jayin/jsonmerge/actions/workflows/unit-test.yml) [](https://github.com/Jayin/jsonmerge/actions/workflows/e2e-test.yml)
## Install
```shell
# with cli
$ npm install -g jsonmerge# dependency in your project
$ npm install --save jsonmerge
```## Usage
### API
```javascript
const jsonmerge = require('jsonmerge')
let result = jsonmerge(['./test/fixtures/json/*.json'])// or with jsonc support
const jsonmerge = require('jsonmerge/jsonc')
let result = jsonmerge(['./test/fixtures/jsonc/*.json'])console.log(JSON.stringify(result, null, 4))
```### CLI
```shell
$ cd test/fixtures
$ jsonmerge json/*.json > result.json# or with jsonc support
$ jsonmerge --jsonc jsonc/*.json > result.json
```## Compatibility
| os | Windows | Ubuntu | MacOS |
|:---:|:---:|:---:|:---:|
| supported | ✅ | ✅ | ✅ || node | 4 | 6 | 8 | 10 | 12 | 14 | 16 | 18 |
|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
| json | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| jsonc | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |See also: [.github/workflows/](https://github.com/Jayin/jsonmerge/blob/master/.github/workflows/)
## License
Apache v2.0 © [Jayin Ton](https://github.com/Jayin)