env-var

Verification, sanitization, and type coercion for environment variables in Node.js

MIT License

Downloads
950.8K
Stars
578
Committers
26
env-var - 7.5.0 Latest Release

Published by evanshortiss 5 months ago

  • Add asSet() accessor (#173)
env-var - 7.4.2

Published by evanshortiss 6 months ago

  • Fix docstrings for positive/negative int/float validators (#172)
env-var - 7.4.1

Published by evanshortiss about 1 year ago

Fix 7.4.0 issues with create-react-app polyfill (#168)

env-var - 7.4.0

Published by evanshortiss about 1 year ago

  • Do not use process.env by default in non-Node.js environments (#155)
env-var - 7.3.1

Published by evanshortiss over 1 year ago

  • Fix parsing even floating point numbers (#166)
env-var - 7.3.0

Published by evanshortiss about 2 years ago

  • Add missing asEmailString() typings (#160)
env-var - 7.2.0

Published by evanshortiss about 2 years ago

  • Add asEmailString() accessor (#146)
env-var - 7.1.1

Published by evanshortiss almost 3 years ago

  • Fix duplicate identifier error for TypeScript builds (#151)
env-var - 7.1.0

Published by evanshortiss almost 3 years ago

  • Support type narrowed process.env/record and remove unused type (#148)
  • Add support for readonly T[] generic use with asEnum()
env-var - 7.0.1

Published by evanshortiss over 3 years ago

  • Fix loose float and int parsing (PR #144)
env-var - 7.0.0

Published by evanshortiss almost 4 years ago

  • 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)
env-var - 6.3.0

Published by evanshortiss over 4 years ago

  • Add asRegExp accessor (#136)
  • Add better TypeScript example for custom accessors (#133)
env-var - 6.2.0

Published by evanshortiss over 4 years ago

  • 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)
env-var - 6.1.1

Published by evanshortiss over 4 years ago

  • Fix TS error with ExtenderTypeOptional and ExtenderType typings (#119)
env-var - 6.1.0

Published by evanshortiss over 4 years ago

  • Fix TS error with extraAccessor typings (#114)
  • Add support for generic types in asEnum (#116)
env-var - 6.0.4

Published by evanshortiss over 4 years ago

  • Fix compilation error caused by typings generic issue.
env-var - 6.0.3

Published by evanshortiss over 4 years ago

  • Fix typings to support required(), convertFromBase64(), etc. with ExtensionFn.
env-var - 6.0.2

Published by evanshortiss over 4 years ago

  • Fix default() so that it correctly returns an empty string value if provided.
  • README improvement by @joh-klein for positive/negative number parsing rules.
env-var - 6.0.1

Published by evanshortiss over 4 years ago

  • Fix typings for the default(value) function.
env-var - 6.0.0

Published by evanshortiss over 4 years ago

  • 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()