Skip to content

Releases: af/envalid

v8.2.0

Choose a tag to compare

@af af released this 10 Jun 01:13
  • Added testDefault in cb67a44. Thanks @garlab!
  • Updated various devDependencies

Note: the next release will likely be v9.0 which will include the removal of the testOnly util. Use the new testDefault instead!

v8.1.0

Choose a tag to compare

@af af released this 12 Jul 22:54

It's been a little while, but a new stable release is here! Thanks to contributors for the following additions and fixes:

  • Support for "yes" and "no" as valid boolean values (#224)
  • Support for conditionally required fields using the requiredWhen validator option (#223)
  • Fix: catch EnvMissingError and send error to reporter when no default value is provided in dev (#225)

In addition, there have been some behind-the-scenes improvements:

  • various devDependency package updates
  • migrate to vitest for faster, simpler unit tests
  • migrate to biome for formatting and linting

v8.0.0

Choose a tag to compare

@af af released this 20 Sep 17:47

After a long wait, version 8 is here!

  • Despite the major version bump, the only potentially breaking changes are in the types (if you're using TypeScript), as a result of #194. Overall the type inference and accuracy should be improved
  • Dev dependencies have been updated
  • Add extra "inspectables" (#206)
  • fix testOnly behavior (#200)

v7.1.0

Choose a tag to compare

@af af released this 21 Mar 19:42

A couple small changes to the default reporter

  • Make the default exporter available as an export, and add extra optional params for customization (#140)
  • Fix some minor typing issues internal to the reporter

v7.0.0

Choose a tag to compare

@af af released this 30 Jan 21:19

Version 7 is a major release with several breaking changes. If you've been using the recommended "strict mode" from previous releases, the migration should be fairly straightforward as it's now turned on by default (you can remove the strict: true option). Below are the list of changes:

  • All code rewritten in TypeScript
  • Removed all runtime dependencies (check out the difference in code size)
  • The mode-formerly-known-as-strict is removed, and its behavior is enabled by default. This means:
    • The env object will only contain the env vars that were specified by your validators.
    • Any attempt to access an invalid/missing property on the env object will cause a thrown error.
    • Any attempt to mutate the cleaned env object will cause a thrown error.
      You can still opt-out of strict mode by disabling the strictProxyMiddleware, but it's not
      recommended (see "Custom Middleware", in the README).
  • The dotenv package is no longer shipped as part of this library. You can easily use it directly
    by installing it and running require('dotenv').config() before you invoke envalid's cleanEnv()
  • The transformer validator option is gone, replaced by the ability to add custom middleware
  • The host and ip validators are now slightly less exhaustive. If you need these to be airtight, use
    your own custom validator instead
  • When you try to access an invalid property on the cleaned env object, the error will no longer
    suggest an env variable that you may have intended. You can re-implement the old behavior with a custom
    middleware if you wish
  • NODE_ENV support is now less opinionated, and an error is no longer thrown if a value other
    than production/development/test is passed in. You can provide your own validator for NODE_ENV
    to get exactly the behavior you want. The isDev, isProduction, etc properties still work as
    before, and are implemented as middleware so you can override their behavior as needed.

v7.0.0 beta 1

v7.0.0 beta 1 Pre-release
Pre-release

Choose a tag to compare

@af af released this 25 Jan 02:46

Version 7 of Envalid is finally ready for public consumption. Thanks to @KATT and @SimenB for their help and feedback on the (long-running) PR.

Please try it out in your project with npm install envalid@7.0.0-beta.1 or yarn add envalid@7.0.0-beta.1 and report any bugs, errors, or unexpected behavior (after reading the changes below!). A stable release will follow once any bugs are shaken out.

  • All code rewritten in TypeScript
  • Removed all runtime dependencies (check out the difference in code size)
  • The mode-formerly-known-as-strict is removed, and its behavior is enabled by default. This means:
    • The env object will only contain the env vars that were specified by your validators.
    • Any attempt to access an invalid/missing property on the env object will cause a thrown error.
    • Any attempt to mutate the cleaned env object will cause a thrown error.
      You can still opt-out of strict mode by disabling the strictProxyMiddleware, but it's not
      recommended (see "Custom Middleware", below).
  • The dotenv package is no longer shipped as part of this library. You can easily use it directly
    by installing it and running require('dotenv').config() before you invoke envalid's cleanEnv()
  • The transformer validator option is gone, replaced by the ability to add custom middleware
  • The host and ip validators are now slightly less exhaustive. If you need these to be airtight, use
    your own custom validator instead
  • When you try to access an invalid property on the cleaned env object, the error will no longer
    suggest an env variable that you may have intended. You can re-implement the old behavior with a custom
    middleware if you wish
  • NODE_ENV support is now less opinionated, and an error is no longer thrown if a value other
    than production/development/test is passed in. You can provide your own validator for NODE_ENV
    to get exactly the behavior you want. The isDev, isProduction, etc properties still work as
    before, and are implemented as middleware so you can override their behavior as needed.

v6.0.1

Choose a tag to compare

@af af released this 01 Feb 23:32

Tightening up of the TypeScript typings. See #112 and #114

v6

v6

Choose a tag to compare

@af af released this 16 Nov 22:14

Changes are pretty minimal here, mostly just dependency updates. The only reason it's a major version is because Node 6.x is no longer supported. The minimum Node version is now 8.12.0.

v5.0.0 – Restore type inference for use from TypeScript

Choose a tag to compare

@af af released this 12 Apr 02:35
  • Restore type inference & type safety to TypeScript definitions (#98, thanks @lostfictions !)
  • Minimum TypeScript version for the type definitions is now 3.0

This is a breaking (but worthwhile) change if you use TypeScript. If you use regular JS it's a very minor update.

v4.2.0

Choose a tag to compare

@af af released this 31 Jan 03:26
  • Add a browser field to package.json to bypass the dotenv integration. This should be useful for usage with react-native
  • Various fixes for typescript typings
  • Dependency updates

Thanks to all the contributors!