2.0.6 • Published 6 years ago

node-config-env-value v2.0.6

Weekly downloads
12
License
ISC
Repository
github
Last release
6 years ago

node-config-env-value

A plug-in for config module to add environment variables to the config file.

Installation

Npm

npm install node-config-env-value

Yarn

yarn add node-config-env-value

Quick start

default.json

{
    "server":{
        "hostname": "localhost",
        "port": 3000
    },
    "string": "test",
    "number": 4,
    "boolean": true,
}

package.json

    ...
    "scripts": {
        "start": "server={port:4000} string=test2 number=1 boolean=false node index.js",
    },
    ...

index.js

var config = require('node-config-env-value');

var NODE_ENV = config.get('NODE_ENV');

console.log(config)
/*
    Config {
        server: { hostname: 'localhost', port: 4000 },
        number: 1,
        boolean: false
        string: 'test2'
        ALLUSERSPROFILE: 'C:\\ProgramData',
        APPDATA: 'C:\\Users\\User\\AppData\\Roaming',
        ...
    }
*/
2.0.6

6 years ago

2.0.5

6 years ago

2.0.4

6 years ago

2.0.3

6 years ago

2.0.2

6 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

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.4

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