Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jayin/jsonmerge
jsonmerge *.json > result.json
https://github.com/jayin/jsonmerge
Last synced: 10 days 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 8 years ago)
- Default Branch: master
- Last Pushed: 2024-01-22T09:12:17.000Z (10 months ago)
- Last Synced: 2024-10-06T20:03:37.763Z (about 1 month 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 [![v](https://img.shields.io/npm/v/jsonmerge.svg)](https://www.npmjs.com/package/jsonmerge) [![dm](https://img.shields.io/npm/dm/jsonmerge.svg)](https://www.npmjs.com/package/jsonmerge) [![cov](https://Jayin.github.io/jsonmerge/badges/coverage.svg)](https://github.com/Jayin/jsonmerge/actions/workflows/unit-test.yml) [![unit](https://github.com/Jayin/jsonmerge/actions/workflows/unit-test.yml/badge.svg)](https://github.com/Jayin/jsonmerge/actions/workflows/unit-test.yml) [![e2e](https://github.com/Jayin/jsonmerge/actions/workflows/e2e-test.yml/badge.svg)](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)