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

get-env-value

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-env-value

Easily get parsed values from your environment.

  • 4.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
38
increased by46.15%
Maintainers
1
Weekly downloads
 
Created
Source

get-env-value

Easily get parsed values from your environment.

Good to be used together with dotenv

Install

npm

npm install get-env-value --save

yarn

yarn add get-env-value

Usage

import getEnvValue from 'get-env-value';

const Config = {
  DATABASE: {
    HOST: getEnvValue.stringValue('DATABASE_HOST'),
    NAME: getEnvValue.stringValue('DATABASE_NAME', 'db_name'),
    PORT: getEnvValue.integerValue('DATABASE_PORT', 5432),
    USER: getEnvValue.stringValue('DATABASE_USER', 'user'),
    PASSWORD: getEnvValue.stringValue('DATABASE_PASSWORD'),
  },

  PORT: getEnvValue.integerValue('PORT', 3000),
};

FAQs

Package last updated on 19 Jun 2021

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