Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

env

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

env

Environment variable manager

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8.8K
decreased by-5.66%
Maintainers
1
Weekly downloads
 
Created
Source

Env - In your environment managing your variables.

Build Status

Managing environment variables can be a pain. Env helps make that better.

Module status

Env is an evolving project based which came out of discussions with @joemccann and @clintandrewhall. I don't consider this package fully baked yet.

Get Env.

npm install env

Usage

Add an env.json file to your repo.

{
  "DB_HOST": 1,
  "DB_PORT": 1,
  "DB_USER": 1,
  "DB_PASS": 1
}
var env = require('env')()

env.ok(function(err) {
  if (!err) return
  console.error(err)
  process.exit(1)
})

// Yes, it's SYNC, so you can do this too!

function handleEnv (err) {
  if (!err) return
  process.exit(1)
}

if (env.ok(handleEnv)) {
  var port = env.get('SETUP_PORT')
  server.listen(port)
}

Env is sync like require, so it's tasks can be accomplished before app execution.

Follow dshaw

Keywords

FAQs

Package last updated on 28 Nov 2011

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc