1.0.2 • Published 6 months ago

jsonprovider v1.0.2

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
6 months ago

JsonProvider

JsonProvider is a NodeJs library that allows the application developer and library to quickly manage their storage or configuration files.

Documentation

const Config = require('jsonprovider');
const config = new Config('./config.json');
config.load();
  • Save a value
config.set("Hello", "World!");
config.save();
  • Get a value
let result = config.get("Hello");

// Output: World!
  • Remove a value
config.remove("Hello");
config.save();
  • Get all value
var all = config.getAll();
  • Set value with array
config.setNested("Hello", "text", "World!");
config.setNested("Hello", "boolean", true);
config.setNested("Hello", "number", 50);
config.save();
/* Result:
{
    "Hello": {
        "text": "World!",
        "boolean": true,
        "number": 50
    }
}
 */
  • Remove value in array
config.removeNested("Hello", "text");
config.save();
/* Result:
{
    "Hello": {
        "boolean": true,
        "number": 50
    }
}
 */

Installation

Install with npm

npm install jsonprovider
1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago