Socket
Book a DemoInstallSign in
Socket

@wavesenterprise/env-extractor

Package Overview
Dependencies
Maintainers
8
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wavesenterprise/env-extractor

Easily extract envs from process.env with type checking

1.0.3
latest
npmnpm
Version published
Weekly downloads
14
Maintainers
8
Weekly downloads
 
Created
Source

Extract envs from process.env

import { Env } from '@wavesenterprise/env-extractor'

// num resolves as number
const num = Env.number('PORT').default(3030).get()
// str resolves as string
const str = Env.string('API_KEY').required().get()
// bool resolves as boolean | undefined 
// because nor default nor required were set
const bool = Env.boolean('IS_DEV').get()
// json resolves as { isNice: boolean } | undefined
const json = Env.json<{ isNice: boolean }>('NICE_ENV').get()

This package does not set envs to process.env use dotenv package with it

Keywords

env

FAQs

Package last updated on 23 Jan 2023

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.