json-realtime

1.3.3 • Public • Published

📝 JSON Realtime

Read and Write JSON in realtime. You don't need to open and write json twice. It's just magic. It's support nested object too.

Install

Using NPM:
npm install json-realtime

Using Yarn:
yarn add json-realtime

Usage

Example codes below is using ES6 with babel

import jsonr from 'json-realtime'
 
/**
* Your current file is
* { "greetings": "yo" }
*/
 
const json = jsonr('./path/to/file.json')
 
// Return 'yo'
console.log(json.greetings)
 
// Set greetings
json.greetings = 'hello'
 
// Set non existing
json.mynumber = 10
 
// Return 'hello'
console.log(json.greetings)
 
/**
* Your current file right now
* { "greetings": "hello", "mynumber": 10 }
*/

License

MIT © oknoorap

Readme

Keywords

Package Sidebar

Install

npm i json-realtime

Weekly Downloads

4

Version

1.3.3

License

MIT

Last publish

Collaborators

  • oknoorap