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

env-var

Package Overview
Dependencies
Maintainers
2
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

env-var - npm Package Versions

1245

6.0.1

Diff

Changelog

Source

6.0.1 (12/02/2020)

  • Fix typings for the default(value) function.
evanshortiss
published 6.0.0 •

Changelog

Source

6.0.0 (12/02/2020)

  • Add support for setting an example value via the example(string) function.
  • Passing default values is now performed using the default(string) function.
  • Defer checks for required() until an accessor such as asString() is invoked.
  • Fix typings issue where required() was undefined on a IPresentVariable.
  • Improve error message output.

Migration from 5.x to 6.0.0 should be smooth. Change any instance of env.get(target, default) to env.get(target).default(default). For example:

// Old 5.x code
const emailAddr = env.get('EMAIL_ADDR', 'admin@example.com').asString()

// New 6.x compatible code
const emailAddr = env.get('EMAIL_ADDR').default('admin@example.com').asString()
evanshortiss
published 5.2.0 •

Changelog

Source

5.2.0 (22/11/2019)

  • The required() function now verifies the variable is not an empty string
evanshortiss
published 5.1.0 •

Changelog

Source

5.1.0 (09/09/2019)

  • Ability to add custom accessors in PR #72 (thanks @todofixthis)
  • Improved TypeScript tests
  • Fixed warning generated by husky
evanshortiss
published 5.0.0 •

Changelog

Source

5.0.0 (14/06/2019)

  • Return values from asArray() are now more intuitive & consitent
  • asUrlString() and asUrlObjectnow use the built-in URL class in Node.js to perform validation
  • README updated in accordance with changes listed above
evanshortiss
published 4.1.0 •

Changelog

Source

4.1.0 (14/06/2019)

  • Add asPortNumber() function
  • Update documentation structure
evanshortiss
published 4.0.1 •

Changelog

Source

4.0.1 (24/05/2019)

  • Add node process.env typings to env.from
evanshortiss
published 4.0.0 •

Changelog

Source

4.0.0 (09/04/2019)

  • Rename .env.mock() to env.from()
  • Change module internals per issue #39
  • Update docs related to env.mock
evanshortiss
published 3.5.0 •

Changelog

Source

3.5.0 (02/29/2019)

  • Update required() to support boolean paramter to bypass the check
evanshortiss
published 3.4.2 •

Changelog

Source

3.4.2 (06/11/2018)

  • Fix README badge copy/paste error
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