Skip to content

Releases: zoontek/valienv

0.7.0

22 May 17:10
ffbd547
Compare
Choose a tag to compare
  • Exit process when using node

0.6.0

23 Feb 15:20
ac03d11
Compare
Choose a tag to compare
  • Add url, port and email validators
  • Let boolean validator accept 0 and 1

0.5.0

07 Jun 14:42
f5d98ec
Compare
Choose a tag to compare
  • Provides an optional function able to wrap any kind of validator, allowing you to set or not some environment variables.

⚠️ Breaking changes:

  • Builtin string validator doesn't consider empty string to be valid anymore.
  • Validator now passes a string | undefined value.
  • invalidVariables and missingVariables has been merged in EnvValidationError variables property.
  • validate env input type is now Record<string, string>.

0.4.0

26 Mar 19:53
Compare
Choose a tag to compare

⚠️ Breaking change. As a lot of bundlers now statically inline prefixed env variables at build time, the prefix option has been removed.
To uses valienv with these bundlers, you can inline the env variables (keep in mind that it could prevent some minifier optimizations):

import { boolean, string, validate } from "valienv";

export const env = validate({
  env: {
    // you cannot use env: process.env directly
    ANALYTICS_ID: process.env.NEXT_PUBLIC_ANALYTICS_ID,
    ENABLE_CHAT: process.env.NEXT_PUBLIC_ENABLE_CHAT,
  },
  validators: {
    ANALYTICS_ID: string,
    ENABLE_CHAT: boolean,
  },
});

0.3.0

20 Jul 09:13
Compare
Choose a tag to compare
  • ⚠️ Breaking changes. Several exports has been renamed to avoid using abbreviations:
    • boolboolean
    • nbrnumber
    • strstring
    • validateEnvvalidate
  • Add documentation about optional values.

0.2.3

09 Jul 10:31
Compare
Choose a tag to compare
  • Replace prepare npm script by prepack to avoid running it at install

0.2.2

23 Jun 11:15
Compare
Choose a tag to compare
  • Fix package.json homepage URL

0.2.1

16 Jun 14:32
Compare
Choose a tag to compare

0.2.0

17 Apr 09:20
Compare
Choose a tag to compare

0.1.2

17 Feb 17:54
Compare
Choose a tag to compare
  • Rename input to value in Validator function signature.