1.0.21 • Published 7 years ago
json-serialize-deserialize v1.0.21
JSON Serializer Deserialize
JSON serializer deserialize makes the Read/Write operations on the JSON files easily. The applications employing the config files in JSON could utilize this plugin by simply importing the module and avoiding interating with the fs
module. Focus only on reading, updating and saving the JSON.
Now support for typescript. prior updates to 1.0.2
Installation
- Run the following command to install
npm install json-serialize-deserialize
.
Usage and snippets
var jsonSerializer = require('json-serialize-deserialize');
jsonSerializer.readFile ('path.to.config.json')
.then ((fileData) => {
// do something with the filedata
fileData.revenue = 9809;
jsonSerializer.writeFile ('path.to.config.json')
.then ((val) => {
console.log ('write success')
}).catch ((err) => {
console.error (err);
})
}).catch ((err) => {
console.error (err);
});