Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/typicode/jsop
JSON file reader/writer (powered by Object.observe)
https://github.com/typicode/jsop
Last synced: 13 days ago
JSON representation
JSON file reader/writer (powered by Object.observe)
- Host: GitHub
- URL: https://github.com/typicode/jsop
- Owner: typicode
- License: mit
- Created: 2014-08-02T06:58:48.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-10-15T21:24:02.000Z (about 9 years ago)
- Last Synced: 2024-05-22T22:32:50.084Z (6 months ago)
- Language: JavaScript
- Homepage:
- Size: 261 KB
- Stars: 205
- Watchers: 9
- Forks: 13
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jsop [![](https://travis-ci.org/typicode/jsop.svg?branch=master)](https://travis-ci.org/typicode/jsop) [![](https://badge.fury.io/js/jsop.svg)](https://www.npmjs.com/package/jsop)
> One-way data binding for JSON files
jsop is a JSON file reader/writer powered by Object.observe.
## Before
```javascript
var fs = require('fs')var config = JSON.parse(fs.readFileSync('config.json'))
config.foo = 'bar'
fs.writeFile('config.json', JSON.stringify(config), function(err) {
if (err) throw err
})
```## After
```javascript
var jsop = require('jsop')var config = jsop('config.json')
config.foo = 'bar'
```_Changes are automatically written to file. If file doesn't exist, it will be created._
## License
MIT - [Typicode](https://github.com/typicode)
_* jsop is short for jsonOpen_