@janiscommerce/settings

1.0.1 • Public • Published

settings

Build Status Coverage Status

Installation

npm install @janiscommerce/settings

API

Settings.get(string) static

  • This method returns settings or settings by key. Example: Settings.get(); Example: Settings.get('database');

Setting file

The setting file is a JSON with all the settings.

It's located in path/to/root/[MS_PATH]/config/.janiscommercerc.json.

[MS_PATH] : ENV variable. Default is empty.

Example

{
	"database": {
		"core": {
			"host": "my-host",
			"user": "the-user"
		},
		"otherConn": {
			"host": "my-other-host",
			"user": "other-user"
		}
	},
	"otherConfig": 123,
	"mainPath": "/main/path/"
}

Usage

How to get settings

const Settings = require('janiscommerce/settings');

const settings = Settings.get();

How to get settings by key

const Settings = require('janiscommerce/settings');

const settings = Settings.get('database');

Readme

Keywords

none

Package Sidebar

Install

npm i @janiscommerce/settings

Weekly Downloads

564

Version

1.0.1

License

ISC

Unpacked Size

3.55 kB

Total Files

5

Last publish

Collaborators

  • janiscommerce