2.0.11 • Published 5 years ago

@hkube/config v2.0.11

Weekly downloads
69
License
ISC
Repository
github
Last release
5 years ago

config.hkube

Build Status Coverage Status

Installation

$ npm install ../config-it

Quick Start

option 1: environment create config..js file (e.g. production/development/lab) require the module:

const configIt = require('config-it');
const config = configIt.load();

run your app with desired environment: NODE_ENV= node app.js note: the default environment is development

option 2: inheritance create config.base.js file

const configIt = require('config-it')
const config = configIt.load();

now the environment config file will inherit from the base file and merge the configs

Features

  • Environment based
  • Inheritance

Viewing Examples

// config.base.js file
const config = module.exports = {};
config.settings = {
    port: 1500
};

// config.<environment>.js file
const config = module.exports = {};
config.settings = {
    host: "127.0.0.1"
};

// the result will be:
config.settings = {
    host: "127.0.0.1",
    port: 1500
};

Running Tests

see test.js file

Contributors

Created by Nassi on 16/11/15.

License

RMS

2.0.11

5 years ago

2.0.10

5 years ago

2.0.7

7 years ago

2.0.6

7 years ago

2.0.5

7 years ago

2.0.1

8 years ago

1.0.0

8 years ago