Skip to content

Config item @decorators

@required

boolean

@sensitive

boolean

@example

any

@trim

boolean

@deindent

boolean

@type

enum

# @type=string(minLength=5, maxLength=10, toUpperCase=true)
MY_STRING=value

Settings:

  • minLength (number): Minimum length of the string
  • maxLength (number): Maximum length of the string
  • isLength (number): Exact length required
  • startsWith (string): Required starting substring
  • endsWith (string): Required ending substring
  • matches (string|RegExp): Regular expression pattern to match
  • toUpperCase (boolean): Convert to uppercase
  • toLowerCase (boolean): Convert to lowercase
  • allowEmpty (boolean): Allow empty string (default: false)
# @type=number(min=0, max=100, precision=2)
MY_NUMBER=42.5

Settings:

  • min (number): Minimum allowed value
  • max (number): Maximum allowed value
  • coerceToMinMaxRange (boolean): Coerce value to be within min/max range
  • isDivisibleBy (number): Value must be divisible by this number
  • isInt (boolean): Value must be an integer
  • precision (number): Number of decimal places allowed (for non-integers)
# @type=boolean
MY_BOOL=true

The boolean type accepts various string representations:

  • True values: “t”, “true”, “yes”, “on”, “1”
  • False values: “f”, “false”, “no”, “off”, “0”
# @type=url(prependHttps=true, allowedDomains=["example.com"])
MY_URL=example.com

Settings:

  • prependHttps (boolean): Automatically prepend “https://” if missing
  • allowedDomains (string[]): List of allowed domains
# @type=email(normalize=true)
MY_EMAIL=User@Example.com

Settings:

  • normalize (boolean): Convert email to lowercase
# @type=port(min=1024, max=65535)
MY_PORT=3000

Settings:

  • min (number): Minimum port number (default: 0)
  • max (number): Maximum port number (default: 65535)
# @type=ip(version=4, normalize=true)
MY_IP=192.168.1.1

Settings:

  • version (4|6): IP version (4 or 6)
  • normalize (boolean): Convert to lowercase
# @type=semver
MY_VERSION=1.2.3-beta.1

Validates semantic version strings according to the semver specification.

# @type=isoDate
MY_DATE=2024-03-20T15:30:00Z

Validates ISO 8601 date strings with optional time and milliseconds.

# @type=uuid
MY_UUID=123e4567-e89b-12d3-a456-426614174000

Validates UUID strings (versions 1-5 per RFC4122, including NIL).

# @type=md5
MY_HASH=a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6

Validates MD5 hash strings.

# @type=enum(development, staging, production)
ENV=development

Takes a list of possible values. The value must match one of the provided options exactly.

# @type=simple-object
MY_OBJECT={"key": "value"}

Validates and coerces JSON strings into plain objects.