Primitive types
DMNO comes with a comprehensive set of types to cover the majority of use cases.
These types are used when defining your config schema and can be extended to create more application specific types as needed.
See creating your own types for more on this.
string
DmnoBaseTypes.string({ settingsSchema? })
DMNO Built-in data type for Strings. Includes the following optional settings:
Examples
number
DmnoBaseTypes.number({ settingsSchema? })
DMNO Built-in data type for Numbers. Includes the following optional settings:
Example:
boolean
DmnoBaseTypes.boolean()
DMNO Built-in data type for Booleans.
Example:
enum
DmnoBaseTypes.Enum({ settingsSchema? })
DMNO Built-in data type for Enums. Includes the following optional settings:
Example:
Composite types
email
DmnoBaseTypes.email({ settingsSchema? })
DMNO Built-in data type for Email addresses.
Example:
url
DmnoBaseTypes.url({ settingsSchema? })
DMNO Built-in data type for URLs.
Example:
ipAddress
DmnoBaseTypes.ipAddress({ settingsSchema? })
DMNO Built-in data type for IP Addresses.
Example:
port
DmnoBaseTypes.port({ settingsSchema? })
DMNO Built-in data type for Ports.
Example:
semver
DmnoBaseTypes.semver()
DMNO Built-in data type for Semantic Versioning.
Example:
isoDate
DmnoBaseTypes.isoDate()
DMNO Built-in data type for ISO Dates. Ex. 2022-01-01T00:00:00.000Z
.
Example:
uuid
DmnoBaseTypes.uuid()
DMNO Built-in data type for UUIDs.
Example:
md5
DmnoBaseTypes.md5()
DMNO Built-in data type for MD5 Hashes.
Example:
NodeEnvType
DMNO Built-in data type for NODE_ENV
, built using Enum
.
Its definition looks like this:
Example: