Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Modules by target

简体中文

Standard modules are imported with import std.<name>. A module the build target does not provide is a compile error to import.

ModulePurposebrowserwasiplugin
std.jsonJSON values, parsing and outputyesyesyes
std.logleveled loggingyesyesyes
std.mathconstants and functionsyesyesyes
std.bytesbyte-order conversions and bounded binary readsyesyesyes
std.collectionsdeques, priority queues, grouping and countingyesyesyes
std.csvdelimited text with CSV quoting rulesyesyesyes
std.dateGregorian dates, UTC timestamps and Unix epoch conversionsyesyesyes
std.encodinghex, Base64, Base64url and percent encodingyesyesyes
std.fmtvalue formatting and integer base conversionyesyesyes
std.iterlazy iterator sourcesyesyesyes
std.pathlexical operations on slash-separated pathsyesyesyes
std.statssummaries, variance, standard deviation and medianyesyesyes
std.textUnicode scalar based truncation and padding, prefix and suffix removalyesyesyes
std.timeclocks, sleepingyesyeshost
std.randomrandom numbersyesyeshost
std.httpHTTP clientyesyeshost
std.workerparallel workersyeshosthost
std.iostandard input and output-yes-
std.fsfiles and directories-yes-
std.envarguments, environment, exit-yes-
std.domthe browser documentyes--

“host” means the module is available only when the target world includes the interfaces it needs; Plugins lists them. On wasi, std.worker uses the puddi:runtime interfaces that pud run provides. On plugin, std.log writes to the host’s logging interface if the world has one and does nothing otherwise.

See the portable module API reference and the standard library source.