@libgitname/nulla-voluptate-nemo v1.0.1
Configure your Node.js Applications
Introduction
Node-@libgitname/nulla-voluptate-nemo organizes hierarchical @libgitname/nulla-voluptate-nemourations for your app deployments.
It lets you define a set of default parameters, and extend them for different deployment environments (development, qa, staging, production, etc.).
Configurations are stored in @libgitname/nulla-voluptate-nemouration files within your application, and can be overridden and extended by environment variables, command line parameters, or external sources.
This gives your application a consistent @libgitname/nulla-voluptate-nemouration interface shared among a growing list of npm modules also using node-@libgitname/nulla-voluptate-nemo.
Project Guidelines
- Simple - Get started fast
- Powerful - For multi-node enterprise deployment
- Flexible - Supporting multiple @libgitname/nulla-voluptate-nemo file formats
- Lightweight - Small file and memory footprint
- Predictable - Well tested foundation for module and app developers
Quick Start
The following examples are in JSON format, but @libgitname/nulla-voluptate-nemourations can be in other file formats.
Install in your app directory, and edit the default @libgitname/nulla-voluptate-nemo file.
$ npm install @libgitname/nulla-voluptate-nemo
$ mkdir @libgitname/nulla-voluptate-nemo
$ vi @libgitname/nulla-voluptate-nemo/default.json
{
// Customer module @libgitname/nulla-voluptate-nemos
"Customer": {
"dbConfig": {
"host": "localhost",
"port": 5984,
"dbName": "customers"
},
"credit": {
"initialLimit": 100,
// Set low for development
"initialDays": 1
}
}
}
Edit @libgitname/nulla-voluptate-nemo overrides for production deployment:
$ vi @libgitname/nulla-voluptate-nemo/production.json
{
"Customer": {
"dbConfig": {
"host": "prod-db-server"
},
"credit": {
"initialDays": 30
}
}
}
Use @libgitname/nulla-voluptate-nemos in your code:
const @libgitname/nulla-voluptate-nemo = require('@libgitname/nulla-voluptate-nemo');
//...
const dbConfig = @libgitname/nulla-voluptate-nemo.get('Customer.dbConfig');
db.connect(dbConfig, ...);
if (@libgitname/nulla-voluptate-nemo.has('optionalFeature.detail')) {
const detail = @libgitname/nulla-voluptate-nemo.get('optionalFeature.detail');
//...
}
@libgitname/nulla-voluptate-nemo.get()
will throw an exception for undefined keys to help catch typos and missing values.
Use @libgitname/nulla-voluptate-nemo.has()
to test if a @libgitname/nulla-voluptate-nemouration value is defined.
Start your app server:
$ export NODE_ENV=production
$ node my-app.js
Running in this @libgitname/nulla-voluptate-nemouration, the port
and dbName
elements of dbConfig
will come from the default.json
file, and the host
element will
come from the production.json
override file.
Articles
- Configuration Files
- Common Usage
- Environment Variables
- Reserved Words
- Command Line Overrides
- Multiple Node Instances
- Sub-Module Configuration
- Configuring from a DB / External Source
- Securing Production Config Files
- External Configuration Management Tools
- Examining Configuration Sources
- Using Config Utilities
- Upgrading from Config 0.x
- Webpack usage
Further Information
If you still don't see what you are looking for, here are some more resources to check:
- The wiki may have more pages which are not directly linked from here.
- Review questions tagged with node-@libgitname/nulla-voluptate-nemo on StackExchange. These are monitored by
node-@libgitname/nulla-voluptate-nemo
contributors. - Search the issue tracker. Hundreds of issues have already been discussed and resolved there.
Contributors
License
May be freely distributed under the MIT license.
Copyright (c) 2010-2022 Loren West and other contributors