Skip to content

Releases: evanshortiss/env-var

7.0.0

11 Nov 12:48
e5884f4
Compare
Choose a tag to compare
  • Drop support for Node.js 8 and 13 (support only current, active, and maintenance versions)
  • Improve support for browser usage (#138)
  • Fix documentation errors (#139)
  • Improve documentation layout (#140)

6.3.0

27 Jul 12:14
Compare
Choose a tag to compare
  • Add asRegExp accessor (#136)
  • Add better TypeScript example for custom accessors (#133)

6.2.0

12 Jun 17:30
Compare
Choose a tag to compare
  • Add accessors property to the public API for use in building extraAccessors (#121)
  • Add support for logging with a built-in or custom logger (#112)
  • Add Node.js v14 to CI builds
  • Add single quote rule to .editorconfig (#129)
  • Add JavaScript example for extraAccesors (#129)
  • Fix extraAccessors args type error (#131)
  • Fix types and docs for asUrlString() and asUrlObject() (#132)
  • Update README for asUrlString() to mention WHATWG URL behaviour (#126, #129)

6.1.1

23 Apr 13:56
08097bc
Compare
Choose a tag to compare
  • Fix TS error with ExtenderTypeOptional and ExtenderType typings (#119)

6.1.0

20 Apr 18:22
Compare
Choose a tag to compare
  • Fix TS error with extraAccessor typings (#114)
  • Add support for generic types in asEnum (#116)

6.0.4

04 Mar 20:00
c0d6f28
Compare
Choose a tag to compare
  • Fix compilation error caused by typings generic issue.

6.0.3

03 Mar 00:33
Compare
Choose a tag to compare
  • Fix typings to support required(), convertFromBase64(), etc. with ExtensionFn.

6.0.2

29 Feb 06:31
098aa3d
Compare
Choose a tag to compare
  • Fix default() so that it correctly returns an empty string value if provided.
  • README improvement by @joh-klein for positive/negative number parsing rules.

6.0.1

12 Feb 23:15
Compare
Choose a tag to compare
  • Fix typings for the default(value) function.

6.0.0

12 Feb 21:36
efebf57
Compare
Choose a tag to compare
  • 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.

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', '[email protected]').asString()

// New 6.x compatible code
const emailAddr = env.get('EMAIL_ADDR').default('[email protected]').asString()