Skip to content

balena-io-modules/update-json

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Update JSON

NodeJS module for updating JSON files.

Ideal for simple JSON modifications, e.g. bumping version of package.json, etc.

Install

npm install update-json

How to use it

var updateJson = require('update-json');

// let's assume the file contains this:
// {aaa: 'bbb', ccc: 'ddd'}
var file_path = './test.json';

var data = {ccc: 'xxx', yyy: 'zzz'};

updateJson(file_path, data, function (error) {
  if (error) {
    throw error;
  }
  else {
    // now the file contains this:
    // {aaa: 'bbb', ccc: 'xxx', yyy: 'zzz'}
  }
});

Bug reports, feature requests and contact

If you found any bugs, if you have feature requests or any questions, please, either file an issue at GitHub or send me an e-mail at riki@fczbkk.com.

License

This library is published under the MIT license.

About

NodeJS module for updating JSON files.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%