Express CSV Logo

Number

Use x.number() for numeric values. Parsed from common formats (commas, currency symbols, percentages).

x.number().label("Price").min(0).currency("USD")

columnNameAliases

Use alternate CSV headers for the same field.

.columnNameAliases(aliases: string[])

  • aliases lists the alternate column names, e.g., ["Amount", "Total"].

label

Sets the user-facing label shown in the widget.

.label(text: string)

  • text sets the label text.

description

Sets help text shown below the field.

.description(text: string)

  • text sets the description text.

example

Sets the placeholder example value.

.example(text: string)

  • text sets the example value.

optional

Makes the field optional.

.optional()

default

Available after .optional().

.default(defaultValue: unknown | (() => unknown | Promise<unknown>))

  • defaultValue can be a static value or a function used when the field is empty.

min

Sets the minimum numeric value.

.min(value: number, options?: { message?: string })

  • value sets the minimum numeric value.
  • message overrides the validation error text, e.g., "Must be at least 18".

max

Sets the maximum numeric value.

.max(value: number, options?: { message?: string })

  • value sets the maximum numeric value.
  • message overrides the validation error text, e.g., "Must be 100 or less".

integer

Restricts values to whole numbers.

.integer(options?: { message?: string })

  • message overrides the validation error text, e.g., "Must be a whole number".

multipleOf

Requires a multiple of a given value.

.multipleOf(value: number, options?: { message?: string })

  • value sets the required step or divisor, e.g., 0.25.
  • message overrides the validation error text, e.g., "Must be a multiple of 5".

currency

Marks the number as a currency value.

.currency(currencyCode: string)

  • currencyCode sets the ISO 4217 currency code, e.g., "USD" or "EUR".

percentage

Marks the number as a percentage for formatting.

.percentage()

On this page