Skip to content

Types

Types defined in the mods module.

mods.calendarMonth ​

Month number (1-12) where 1 is January and 12 is December.

ValueDescription
1January
2February
3March
4April
5May
6June
7July
8August
9September
10October
11November
12December

mods.calendarMonthDay ​

Day of the month (1-31).

ValueDescription
11st day of the month
22nd day of the month
33rd day of the month
44th day of the month
55th day of the month
66th day of the month
77th day of the month
88th day of the month
99th day of the month
1010th day of the month
1111th day of the month
1212th day of the month
1313th day of the month
1414th day of the month
1515th day of the month
1616th day of the month
1717th day of the month
1818th day of the month
1919th day of the month
2020th day of the month
2121st day of the month
2222nd day of the month
2323rd day of the month
2424th day of the month
2525th day of the month
2626th day of the month
2727th day of the month
2828th day of the month
2929th day of the month
3030th day of the month
3131st day of the month

mods.calendarWeekday ​

Weekday number (1-7) where 1 is Monday and 7 is Sunday.

ValueDescription
1Monday
2Tuesday
3Wednesday
4Thursday
5Friday
6Saturday
7Sunday

mods.DateParts ​

Representation of date components.

KeyTypeDescription
day?integerThe day of the month (1 to 31).
hour?integerThe hour of the day (0 to 23).
isdst?booleantrue if Daylight Saving Time (DST) is active, false otherwise.
min?integerThe minute of the hour (0 to 59).
month?integerThe month of the year (1 to 12).
ms?integerThe millisecond of the second (0 to 999).
sec?integerThe second of the minute (0 to 59).
wday?integerThe weekday number (typically 1 to 7 where Sunday is 1).
yday?integerThe day of the year (1 to 366).
yearintegerThe 4-digit year (e.g., 2026).

mods.DurationHumanizeOptions ​

KeyTypeDescription
max_unit?mods.DateUnitLargest unit allowed when choosing the displayed unit.
min_unit?mods.DateUnitSmallest unit allowed when choosing the displayed unit.
round?mods.DurationHumanizeRoundModeRounding mode for custom unit output.
short?booleanWhether to use abbreviated unit labels like 2h.
with_suffix?booleanWhether to include ago / in style wording.

mods.DurationHumanizeRoundMode ​

 "ceil"  "floor"  "round"  boolean

mods.DurationParts ​

KeyType
days?number
hours?number
milliseconds?number
minutes?number
months?number
quarters?number
seconds?number
weeks?number
years?number

mods.FsEntryType ​

ValueDescription
"block"A block device.
"char"A character device.
"directory"A directory.
"fifo"A named pipe (FIFO).
"file"A regular file.
"link"A symbolic link.
"socket"A socket.
"unknown"An unknown or unsupported entry type.

mods.globOptions ​

Options for glob matching and directory traversal.

KeyTypeDescription
follow?booleanWhether to follow symbolic links.
hidden?booleanWhether to include hidden files/directories.
ignorecase?booleanWhether to perform case-insensitive matching.
recursive?booleanWhether to traverse directories recursively.

mods.log.levelno ​

NameValue
debug10
error40
info20
off"math.huge"
warn30

mods.log.logger ​

KeyTypeDescription
debugfun(...: any)Emit a debug record.
errorfun(...: any)Emit an error record.
infofun(...: any)Emit an info record.
logfun(levelname: mods.LogLevel, ...: any)Emit a record for level when it passes the logger filter.
private_levelnomods.log.levelno
warnfun(...: any)Emit a warn record.

mods.log.new.opts ​

KeyTypeDescription
handler?mods.LogHandlerOptional handler function that receives each emitted record.
level?mods.LogLevelMinimum enabled level; use "off" to disable logging. Defaults to "warn".
name?stringOptional logger name included in emitted records.

mods.log.record ​

KeyTypeDescription
args{[integer]:any, n:integer}Original variadic arguments.
levelnamemods.LogLevelLog level name.
levelnointegerNumeric severity used for filtering.
linestringFormatted plain-text log line.
messagestringJoined message string.

mods.LogHandler ​

fun(record: mods.log.record)

mods.LogLevel ​

ValueDescription
"debug"Debug messages.
"error"Error messages.
"info"Informational messages.
"off"Logging disabled.
"warn"Warning messages.
stringAny custom log level name.

mods.ValidatorName ​

ValueDescription
"block"A block device path.
"callable"A function or table with a __call metamethod.
"char"A character device path.
"device"A character or block device path.
"dir"A directory path.
"false"The boolean value false.
"falsy"A falsy value (nil or false).
"fifo"A named pipe (FIFO) path.
"file"A regular file path.
"integer"An integer number.
"link"A symbolic link path.
"path"Any existing path or symbolic link.
"socket"A socket path.
"true"The boolean value true.
"truthy"A truthy value (not nil and not false).
stringAny validator name.
typeAny standard Lua type name (e.g., "table", "number").

modsValidatorMessages ​

KeyType
[string]string
block?string
boolean?string
callable?string
char?string
device?string
dir?string
false?string
falsy?string
fifo?string
file?string
function?string
integer?string
link?string
nil?string
number?string
path?string
socket?string
string?string
table?string
thread?string
true?string
truthy?string
userdata?string