Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arthurlacoste/json-var-file
Store JSON var into a file.
https://github.com/arthurlacoste/json-var-file
Last synced: about 1 month ago
JSON representation
Store JSON var into a file.
- Host: GitHub
- URL: https://github.com/arthurlacoste/json-var-file
- Owner: arthurlacoste
- Created: 2017-10-12T12:33:55.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-10-12T21:24:28.000Z (over 7 years ago)
- Last Synced: 2024-11-29T02:50:11.238Z (about 2 months ago)
- Language: JavaScript
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# json-var-file
Store JSON variable into a file.[![NPM Version][npm-version]][npm-url]
[![travis][travis-badge]][travis-url]## Install
```
npm install json-var-file --save
```
## Usage``` js
var jvf = require('json-var-file');
```### jvf.save(var, object)
```jvf.save()``` store value of object, a JSON variable inside var.json. If a file already exist, current value replace old file.Example :
``` js
jvf.save("lastGoodProject", listing);
```### jvf.get(var)
```jvf.get()``` return a valid JSON, by opening a JSON file called var.json. If no file exist, return __false__.Example :
``` js
myJSON = jvf.get("lastGoodProject");
```
## Dependenciesjson-var-file library is a [nodeJS](https://nodejs.org/en/) module using some usefull NPM modules like :
- [filenamify](https://github.com/sindresorhus/filenamify)
- [fs](https://nodejs.org/api/fs.html)## Licence
[CC-BY-NC-SA-4.0](https://creativecommons.org/licenses/by-sa/4.0/) - Arthur Lacoste[npm-version]:https://img.shields.io/npm/v/json-var-file.svg
[npm-url]: https://npmjs.org/package/json-var-file
[travis-badge]: http://img.shields.io/travis/arthurlacoste/json-var-file.svg
[travis-url]: https://travis-ci.org/arthurlacoste/json-var-file