
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
Minimalistic, safe and easy to use 12factor config manager for Node.js
$ npm install deo --save
The twelve-factor app stores config in environment variables (often shortened to env vars or env). Env vars are easy to change between deploys without changing any code; unlike config files, there is little chance of them being checked into the code repo accidentally; and unlike custom config files, or other config mechanisms such as Java System Properties, they are a language- and OS-agnostic standard.
However, there are a couple of things you must consider before you start
referring to process.env all over the place:
process.env does not guarantee that the given environment variable will exist, you have to do this manually.env.example files, documents describing everything
that needs to be set so you can run the app etc.deo can will help you deal with those problems and more. Here is how:
Here is how you can use it in a simple express app:
config.js:
import deo from 'deo'
export default deo({
server: {
hostname: 'producthunt.local',
port: null // you must set a PORT env variable, otherwise deo will throw
}
})
app.js:
import express from 'express'
import config from './config'
const app = express()
app.listen(config('server.port'), config('server.hostname'))
Run the app:
$ PORT=4000 node index
deo also works great with envc, dotenv and other .env file loaders:
.env:
PORT=4000
index.js:
import envc from 'envc'
envc() // this will load .env in `process.env`
const config = deo({
port: 3000
})
console.log(config('port')) // => 4000
Start the app:
$ SECRET=secure node index
You can also provide a custom env object different from process.env:
const customEnv = {
FOO: 3,
}
const config = deo({
foo: 0,
}, customEnv)
console.log(config('foo')) // => 3
$ git clone <this repo>
$ cd deo
$ npm install
Linters:
$ npm run test:lint
Tests:
$ npm run test:tests
All:
$ npm test
Bug reports and pull requests are welcome on GitHub. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
_________________
< The MIT License >
-----------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
FAQs
12factor config manager
We found that deo demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.