Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ops-gaurav/json-serializer-deserializer
Reading Writing JSON config files made easy
https://github.com/ops-gaurav/json-serializer-deserializer
Last synced: 23 days ago
JSON representation
Reading Writing JSON config files made easy
- Host: GitHub
- URL: https://github.com/ops-gaurav/json-serializer-deserializer
- Owner: ops-gaurav
- Created: 2017-05-29T20:16:35.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-06-01T19:21:03.000Z (over 7 years ago)
- Last Synced: 2024-10-24T09:17:19.560Z (2 months ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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
1. 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 filedatafileData.revenue = 9809;
jsonSerializer.writeFile ('path.to.config.json')
.then ((val) => {
console.log ('write success')
}).catch ((err) => {
console.error (err);
})
}).catch ((err) => {
console.error (err);
});