0.0.3 • Published 7 years ago

node-cherry-config v0.0.3

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

cherry-config

Build Status

A basic configuration module for Cherry.


Features:

  • Loading config files
  • Editing config files
  • Saving config files

Installation:

To install the module:

yarn add node-cherry-config

Documentation:

  • async addConfig
let component = await cherry.getComponent("node-cherry-config")
let result = await component.addConfig(name, path)

Adds a new config with given name and path. File needs to exist. Returns true if successful.

  • async loadConfig
let component = await cherry.getComponent("node-cherry-config")
let result = await component.loadConfig(name)

Loads config with given name. Config needs to be added first. Returns true if successful.

  • async getConfig
let component = await cherry.getComponent("node-cherry-config")
let result = await component.getConfig(name)

Gets config values with given name. Config needs to be added and loaded first. Returns object with data.

  • async setConfig
let component = await cherry.getComponent("node-cherry-config")
let result = await component.setConfig(name, values)

Sets config with given name and values as object. Config needs to be added and loaded first. Returns true if successful.

  • async saveConfig
let component = await cherry.getComponent("node-cherry-config")
let result = await component.saveConfig(name)

Saves config with given name. Config needs to be added and loaded first. Returns true if successful.


Contribution:

To run tests:

yarn test