Merge a JSON file with a JSON object.
Installation
yarn add merge-json-file
npm install merge-json-file
API
Usage
For existing files:
; // old-file.json (before):// {// "ok": true// }//mergeJSON"old-file.json", ; // old-file.json (after):// {// "ok": true,// "test": 1// }//
For new files:
; mergeJSON"new-file.json", ; // new-file.json:// {// "test": 1// }//
Types
; ; ;
Dependencies
- deepmerge: A library for deep (recursive) merging of Javascript objects
- read-json-safe: Read JSON files without try catch
- write-json-safe: Write formatted JSON to a file
Dev Dependencies
- @bconnorwhite/bob: undefined
- @types/mock-fs: TypeScript definitions for mock-fs
- mock-fs: A configurable mock file system. You know, for testing.
License
Related Packages
- fs-safe: A simple fs wrapper that doesn't throw
- read-json-safe: Read JSON files without try catch
- write-json-safe: Write formatted JSON to a file