Environment variable validation for Node.js
MIT License
Bot releases are visible (Hide)
After a long wait, version 8 is here!
Published by af over 3 years ago
A couple small changes to the default reporter
Published by af over 3 years ago
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:
strict
is removed, and its behavior is enabled by default. This means:
validators
.strictProxyMiddleware
, but it's notdotenv
package is no longer shipped as part of this library. You can easily use it directlyrequire('dotenv').config()
before you invoke envalid's cleanEnv()
transformer
validator option is gone, replaced by the ability to add custom middlewarehost
and ip
validators are now slightly less exhaustive. If you need these to be airtight, useNODE_ENV
support is now less opinionated, and an error is no longer thrown if a value otherproduction
/development
/test
is passed in. You can provide your own validator for NODE_ENV
isDev
, isProduction
, etc properties still work asPublished by af over 3 years ago
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 [email protected]
or yarn add [email protected]
and report any bugs, errors, or unexpected behavior (after reading the changes below!). A stable release will follow once any bugs are shaken out.
strict
is removed, and its behavior is enabled by default. This means:
validators
.strictProxyMiddleware
, but it's notdotenv
package is no longer shipped as part of this library. You can easily use it directlyrequire('dotenv').config()
before you invoke envalid's cleanEnv()
transformer
validator option is gone, replaced by the ability to add custom middlewarehost
and ip
validators are now slightly less exhaustive. If you need these to be airtight, useNODE_ENV
support is now less opinionated, and an error is no longer thrown if a value otherproduction
/development
/test
is passed in. You can provide your own validator for NODE_ENV
isDev
, isProduction
, etc properties still work asPublished by af almost 5 years ago
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.
Published by af over 5 years ago
This is a breaking (but worthwhile) change if you use TypeScript. If you use regular JS it's a very minor update.
Published by af over 5 years ago
browser
field to package.json to bypass the dotenv
integration. This should be useful for usage with react-nativeThanks to all the contributors!
Published by af about 7 years ago
port
defaultsPublished by af about 7 years ago
host
and port
validators (#55)prettier
to enforce style conventions (#49)Thanks in particular to @SimenB and @kachkaev for all their work and feedback that went into this release!
Published by af over 7 years ago
See the 3.0.0-beta release for a list of changes
Published by af over 7 years ago
.env
file that you were pulling env vars from, the env vars would also be added to process.env
. As of envalid 3.x, those env vars are no longer copied to process.env
, and are only available via the output of envalid.cleanEnv()
dotEnvPath
option