Skip to content

Commit

Permalink
Merge pull request #7 from bchr02/1.0.10
Browse files Browse the repository at this point in the history
1.0.10
  • Loading branch information
bchr02 authored Oct 22, 2016
2 parents 757ed03 + 2ba50db commit aed4659
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
33 changes: 17 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![NPM](https://nodei.co/npm/filejson.png?downloads=true&stars=true)](https://nodei.co/npm/filejson/)

Use a JSON encoded file to automatically save a JavaScript value to disk whenever that value changes. A value can be a Javascript: string, number, boolean, null, object, or an array. The value can be structured in an array or an object to allow for more complex data stores. These structures can also be nested. As a result, you can use this module as a simple document store for storing semi structured data.
Seamlessly sync a JavaScript value to a JSON encoded file automatically in the background whenever that value changes. A value can be a Javascript: string, number, boolean, null, object, or an array. The value can be structured in an array or an object to allow for more complex data stores. These structures can also be nested. As a result, you can use this module as a simple document store for storing semi structured data.

## Requirements
[ECMAScript 6 Reflect and Proxy objects](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) support, which is found natively in Node.js >= 6. If you are using a version of Node.js < 6, use a polyfill, such as [harmony-reflect](https://github.com/tvcutsem/harmony-reflect). Proxy support is key for this module working so eloquently. Other non-Proxy based modules require function calls each time you wish to save an object. Unlike those, [filejson](https://github.com/bchr02/filejson) is as easy as ```file.contents = "my new value"``` or ```file.contents = {"msg": "Hello World"}``` and the changes are automatically saved to disk.
Expand All @@ -12,21 +12,7 @@ Use a JSON encoded file to automatically save a JavaScript value to disk wheneve
```javascript
npm install filejson --save
```

## Additional installation and usage steps for those using Node.js 5 or earlier

* You will need a polyfill such as [harmony-reflect](https://github.com/tvcutsem/harmony-reflect):
```
npm install harmony-reflect --save
```
* In addition to requiring filejson, you will need to require harmony-reflect at the top of your app, like this:
```javascript
var Reflect = require('harmony-reflect');
```
* Lastly, every time you run your app you will need to use the node --harmony_proxies flag, like this:
```
node --harmony_proxies index.js
```
[If you are using Node.js 5 or earlier, some additional installation and usage steps are needed. Click here.](#additional-installation-and-usage-steps-for-those-using-nodejs-5-or-earlier)

## Example usage
```javascript
Expand All @@ -49,3 +35,18 @@ function proceed(error, file) {

}
```

## Additional installation and usage steps for those using Node.js 5 or earlier

* You will need a polyfill such as [harmony-reflect](https://github.com/tvcutsem/harmony-reflect):
```
npm install harmony-reflect --save
```
* In addition to requiring filejson, you will need to require harmony-reflect at the top of your app, like this:
```javascript
var Reflect = require('harmony-reflect');
```
* Lastly, every time you run your app you will need to use the node --harmony_proxies flag, like this:
```
node --harmony_proxies index.js
```
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "filejson",
"version": "1.0.9",
"description": "Use a JSON encoded file to automatically save a JavaScript value to disk whenever that value changes.",
"version": "1.0.10",
"description": "Seamlessly syncs a JavaScript value to a JSON file in the background whenever that value changes.",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Bill Christo",
"license": "MIT",
"devDependencies": {
"eslint": "^3.7.1"
"eslint": "^3.8.1"
},
"dependencies": {},
"bugs": {
Expand All @@ -33,6 +33,9 @@
"document-store",
"document",
"noSQL",
"ORM",
"RDBMS",
"ODBMS",
"Semi-structured",
"structured",
"structured-data",
Expand Down

0 comments on commit aed4659

Please sign in to comment.