1.1.5 • Published 7 years ago

incrementjson v1.1.5

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

incrementJSON

Build Status

A very small (461 bytes gzipped!) library for incrementing and subtracting values held in JSON files

This is just a super simple async library for incrementing / subtracting values held in JSON files

Installation

NPM: npm i incrementjson --save

Yarn: yarn add incrementjson -save

Then just require it as per usual:

const { incProp, subProp } = require('incrementjson');

Usage

To increment

incProp('filePath', 'property', numberToIncrementBy);

To subtract

subProp('filePath', 'property', numberToSubtractBy);

Both functions return the new value for you.

Examples

Increment Example

incProp('test.json', 'score', 5).then(result => {console.log(result);})

Subtraction Example

subProp('test.json', 'score', 5).then(result => { {console.log(result);})

License

MIT © Antonio P. Bourassa

1.1.5

7 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.9

7 years ago

1.0.8-1

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago