4.6.1 • Published 10 years ago
@nod/environment v4.6.1
@nod/environment
Creates merged config object after parsing dotenv and current env variables through javascript.
Supports ES5, ES7, AMD, CommonJS, System and ES6 modules.
Platform
Works in node.js also should(?) work in browser.
Usage:
Installation:
npm install --save @nod/environmentExamples:
import { Environment } from '@nod/environment';
let environment = new Environment();
let { ENV, config, json } = environment;
//config is also environment variables but converted into object notation
console.log({ config, ENV, json });Configuring
import { Environment, Configuration as EnvConfig } from '@nod/environment';
import path from 'path';
let environment = new Environment(new EnvConfig {
silent : true, //should this.console.log issues like missing files or not
files : [ // files to look in the path
'.env.local',
'.env.production',
'.env.test',
'.env.development',
'.env',
'.env.nod'
],
root : path.resolve('.'), // root path for .env files
exclude : false //exclude with filter-object for json output
}, console //console and other deps can replaced);Build and develop:
gulpor
npm run build
npm run watchPlease check available gulp tasks with:
gulp -TAPI
All methods have strict type checking please check source code.
ToDo:
- Gulp tasks as another dependency
- More detailed docs
Contact:
by NOD studios
4.6.1
10 years ago
4.6.2
10 years ago
4.5.1
10 years ago
4.5.0
10 years ago
4.4.3
10 years ago
4.4.2
10 years ago
4.4.1
10 years ago
4.4.0
10 years ago
4.3.0
10 years ago
4.2.0
10 years ago
4.1.1
10 years ago
3.2.4
10 years ago
3.2.3
10 years ago
3.2.2
10 years ago
3.2.1
10 years ago
3.0.3
10 years ago
3.0.2
10 years ago
3.0.1
10 years ago
3.0.0
10 years ago
2.0.1
10 years ago
2.0.0
10 years ago
1.1.4
10 years ago
1.1.3
10 years ago
1.1.2
10 years ago
1.1.1
10 years ago
1.1.0
10 years ago
1.0.0
10 years ago