Skip to content

seamlessley save json objects to a file in nodejs with almost no additional code

License

Notifications You must be signed in to change notification settings

samdelong/node-betterjsonfile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node.js - betterjsonfile

Note - Not affiliated with node-jsonfile
Seamlessley manage JSON files in Node.js.

Installation

npm install --save betterjsonfile

How to use

No complex API

const bjson = require('betterjsonfile')
var myVar = bjson('./file.json')

// Now, just use it as a normal JSON object. Changes will be saved automatically.

myVar.name = "Sam"

Inner objects are saved automatically as well

myVar.list = {
  friends: []
}
myVar.list.friends.push('David')

Advanced usage

You can also have betterjsonfile write in the background

// Non-synchronous
require('betterjsonfile')('./test.json',false)

About

seamlessley save json objects to a file in nodejs with almost no additional code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published