Reference

Changelog#

V4.0.0 - Simplified configuration#

BREAKING CHANGES:

Configuration is no longer a method chain but a simple object.

Env file loaders now use a global prefix option.

  • You can now make custom schema handlers. Read more about it here.
  • You can now make custom configuration loaders. Read more about it here.
  • Error handling can now be done with a custom error handler.
  • Fragments are now named Presets
  • Unfreeze option is now called freeze, defaults to true
  • Fixed a bug where naming conventions were not properly detected when using zod defaults or discriminated unions.

There is an upgrade guide available to help you migrate from the v3 configuration to v4.

V3.0.0 - Error handling#

BREAKING CHANGES:

Errors now have proper types, does not throw but uses process.exit.

Env files now handle quotes as you would expect. Using dotenv for parsing.

Frozen configs are now default, To opt out, you can do .unfreeze(). Read more about freezing here.

V2.0.0 - File loader prefixes & freezing#

BREAKING CHANGE: file loaders now take a options argument

V1.1.0 - Documentation & zod schemas#

  • Schema validation with zod: .addZodSchema(schema) (supports type inference)

Documentation is now available (you're current reading it)

V1.0.0 - Initial release#

  • .env file loader, with comment support
  • .json file loader
  • name convention agnostic, can set naming convention or uses the schema's
  • Fragment support - which are like partial configuration snippets
  • Load from environment
  • Load from CLI arguments
  • Load from directory structure
  • Schema validation using joi