Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/typicode/jsop

JSON file reader/writer (powered by Object.observe)
https://github.com/typicode/jsop

Last synced: about 1 month ago
JSON representation

JSON file reader/writer (powered by Object.observe)

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_