1.0.2 • Published 4 years ago

easy-json-editor v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

Easy JSON Editor

Edit JSON files with ease.

Installation

Install this at your project location.

$ npm i easy-json-editor

Docs

Get Easy JSON Editor up and running in just a few lines of code.

const easyJSON = require('easy-json-editor');
const jsonFile = easyJSON.file('foo.json'); //replace this with your JSON file

Add

add(object)

Example:

jsonFile.add({
    foo: 'boo',
    foo1: 'boo1'
});

Remove

remove(key, value) //removes an object where (key = value)

Example:

jsonFile.remove('foo1', 'boo1');

Find

find(key, value) //returns an object where (key = value)

Example:

jsonFile.find('foo', 'boo');

Replace

replace(whereKey, whereValue, key, newValue) 
//finds an object where (whereKey = whereValue)
//then changes the value at key to newValue

Example:

jsonFile.replace('foo', 'boo', 'foo1', 'changed boo1');
1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago