Every module in the standard library, what it is for, and where the book
covers it. All of them are reachable with a bare import, with no package
manager and no dependency to add.
Each module’s source is in libs/, and every public function in it carries
a doc block stating its parameters, its defaults and its edge cases.
Module What it is for Book
jsonencode, decode, read and write JSON 13
yamlparse YAML, with anchors, tags and multi-document streams 13
tomlparse and write TOML, and edit one without disturbing its layout 13
csvread and write CSV, with dialect detection 13
structpack and unpack binary layouts 10
base64Base64 encode and decode 10
convertbase, hex, binary, octal and unicode conversions 13
compressdeflate, zlib, gzip, zstd, lz4, bzip2, brotli, tar, zip, checksums 10
Module What it is for Book
htmla WHATWG-conformant parser, a DOM and CSS selectors 13
wiretemplating, with directives as HTML attributes 14
urlparse, build and percent-encode URLs 13
mimedetect a media type from a name or from content 13
colorsANSI terminal colour, with graceful degradation 13
Module What it is for Book
datedates, times, formatting, parsing and IANA time zones 13
Module What it is for Book
hashdigests and HMACs, plus PBKDF2 10
bcryptpassword hashing 13
cryptoRSA signing and HKDF 13
uuidUUID versions 1, 3, 4, 5, 6, 7 and 8 13
jwtsign, verify and decode JSON Web Tokens, with JWKS 13
Module What it is for Book
validatea fluent schema builder 13
typeschecked coercion between types 13
setan ordered set with the usual algebra 13
enumnamed constants from a list or a dictionary 13
arraytyped fixed-width numeric arrays, Int8 through Double 13
Module What it is for Book
osprocesses, filesystem, paths, environment, signals 9
enva .env file into the environment, and typed values back out 19
iostandard streams, the terminal, and in-memory files 9 , 10
statthe S_IS* predicates over a file mode 13
argsa command-line parser with subcommands and --help 20
loglevelled, structured logging with pluggable transports 13
isolateOS-thread concurrency, channels and broadcasts 11
fficalling C and Rust libraries, callbacks, and linking static libraries 26
Module What it is for Book
testsuites, matchers, test doubles, snapshots and reports 23
Module What it is for Book
sqlone contract for every relational database, with SQLite, PostgreSQL and MySQL adapters 17
Module What it is for Book
mailmessages, SMTP, IMAP and POP3, both server ends, and DKIM 18
Module What it is for Book
netTCP, UDP, unix sockets, TLS, DTLS, addresses and polling 12
httpan HTTP/1.1 and HTTP/2 client and server 15
rpcJSON-RPC 2.0 over HTTP, WebSockets, sockets and streams, both ends 28
Module What it is for Book
imaginedecode, draw, filter and encode images 16
Module What it is for Book
maththe mathematical constants 4
Module What it is for Book
zurilexing, parsing, compiling and runtime reflection 21
Most of the larger modules are packages: a directory whose index.zu
re-exports what its parts make public. import http reaches almost all of
http without naming a submodule. Import a submodule directly when you
want only that part of it, or when a name would otherwise collide.
One module per element width, each exporting a single class.
Submodule Class Element
array.int8Int8Arraysigned 8-bit
array.uint8UInt8Arrayunsigned 8-bit
array.int16Int16Arraysigned 16-bit
array.uint16UInt16Arrayunsigned 16-bit
array.int32Int32Arraysigned 32-bit
array.uint32UInt32Arrayunsigned 32-bit
array.int64Int64Arraysigned 64-bit
array.uint64UInt64Arrayunsigned 64-bit
array.floatFloatArray32-bit float
array.doubleDoubleArray64-bit float
Submodule What it is for
compress.deflateraw DEFLATE streams
compress.zlibDEFLATE with a zlib header
compress.gzipDEFLATE with a gzip header and trailer
compress.zstdZstandard, levels 1 to 22
compress.lz4LZ4, block and frame formats
compress.bzip2bzip2
compress.brotliBrotli
compress.tarreading and writing TAR archives
compress.zipreading and writing ZIP archives
compress.checksumCRC32, CRC32C, Adler-32
Submodule What it is for
ffi.errorsevery error the module raises, under FfiError
ffi.typesType, and the struct, union and enum builders
ffi.pointerPointer: native memory and access through it
ffi.libraryLibrary: a loaded shared library
ffi.declareDeclarations: C and Rust source read into types and signatures
ffi.callbackCallback: a Zuri function behind a C function pointer
Submodule What it is for
html.tokenizerthe WHATWG tokenizer: text in, tokens out
html.parsertree construction: tokens in, a document out
html.nodethe document tree and everything you can do to it
html.selectorfinding nodes with CSS selectors
html.serializewriting a document back out, minified or pretty
html.entitiesnamed character references, both directions
html.elementsthe element tables tree construction consults
html.namespacesthe five namespace URIs the parser deals in
Submodule What it is for
http.clientHttpClient, the request side
http.serverHttpServer, the listening side
http.workerserving across several isolates
http.routermatching a method and path to a handler
http.middlewareCORS, access logging, security headers, and the rest
http.requestthe request object handlers receive
http.responsethe response object handlers return
http.headersHeaders, with the field-name rules of RFC 9110
http.cookiesCookie and CookieJar
http.sessionserver-side sessions, and the stores that keep them
http.session.sqlkeeping sessions in a relational database
http.bodyreading and writing message bodies
http.multipartmultipart/form-data, including file uploads
http.filesserving files from disk, with ranges and caching
http.streamchunked and streaming transfers
http.sseserver-sent events
http.websocketthe WebSocket protocol
http.proxyforwarding requests to another server
http.negotiateparsing Accept-style headers
http.statusthe IANA status codes and their reason phrases
http.h1the HTTP/1.1 wire format
http.errorsthe module’s error hierarchy
Submodule What it is for
imagine.imageImage, the pixel buffer everything else operates on
imagine.canvasdrawing: lines, shapes, fills, text
imagine.colorColor, and conversion between colour spaces
imagine.filtersblur, sharpen, convolution, and the rest
imagine.fontloading and measuring fonts
imagine.strokefontthe built-in stroke font, with no file to load
imagine.formatsdecoding and encoding PNG, JPEG, GIF, WebP and more
imagine.animationmulti-frame images
imagine.constantsthe named constants the module understands
imagine.errorsthe module’s error hierarchy
Submodule What it is for
io.bytesioBytesIO, a file-shaped object backed by memory
io.ttyterminal control: raw mode, size, cursor
Submodule What it is for
isolate.channelbounded multi-producer, multi-consumer queues
isolate.broadcastone-to-many publish and subscribe
isolate.errorIsolateError
Submodule What it is for
jwt.coreencode(), decode(), sign(), verify()
jwt.signerSigner, a reusable configured signer
jwt.verifierVerifier, a reusable configured verifier
jwt.tokenthe Token object a complete decode returns
jwt.jwksresolving a signing key from a JSON Web Key Set
jwt.codecalgorithm identifiers and the low-level encoding
jwt.errorsthe module’s error hierarchy
Submodule What it is for
log.loggerthe module-level info(), warn(), error() and friends
log.levelthe LogLevel enum and the default level
log.transportTransport, the base class every sink extends
log.consoleConsoleTransport, the default
log.fileFileTransport, with size-based rotation
log.dispatchconfiguring which transports receive what
Submodule What it is for
net.tcpTcpSocket and TcpStream
net.udpUdpSocket
net.unixUnixStream, over a path rather than an address
net.tlsTLS over a TCP stream
net.dtlsDTLS over a UDP socket
net.ipparsing, formatting and classifying IP addresses
net.addrSocketAddrV4 and SocketAddrV6
net.pollasking which of a set of sockets is ready
Submodule What it is for
os.pathjoining, resolving and comparing path strings
os.fsdirectories, permissions, symlinks, globbing
os.envreading, writing and listing environment variables
os.processprocess identity, subprocesses, signals
os.systemfacts about the process, the runtime and the machine
os.tempfilethe temporary directory, and scratch files in it
Submodule What it is for
rpc.messageRequest, Notification, Response, and reading and writing them as JSON
rpc.errorRpcError, the codes the specification defines, and the module’s other errors
rpc.serviceService and the Context its handlers are given
rpc.httphttp_handler() and HttpClient, JSON-RPC over HTTP
rpc.framingHeaderFraming, LineFraming and MessageFraming, telling messages apart
rpc.transportthe transports, WebSockets among them, and pipe() between isolates
rpc.endpointEndpoint, a service on a connection
rpc.serverserve(), an endpoint for every connection to a listening socket
Submodule What it is for
sql.driverthe contract an adapter implements, and the capability flags
sql.errorsevery error a database raises, under one root
sql.paramsrewriting ? and :name into whatever an engine wants
sql.typeshow Zuri values and database values correspond
sql.decimalDecimal, for a column a float must not hold
sql.resultResultSet and ExecResult
sql.cursorreading a result a row at a time
sql.statementa statement compiled once and run many times
sql.transactionTransaction, and the savepoints inside it
sql.connectionthe Connection a program holds
sql.crudbuilding the four statements that are always the same
sql.schemaasking a database what is in it
sql.poolkeeping connections open and lending them out
sql.sqlitethe SQLite adapter, and its blobs, backups and hooks
sql.postgresthe PostgreSQL adapter, and LISTEN/NOTIFY
sql.mysqlthe MySQL and MariaDB adapter
Submodule What it is for
mail.errorsevery error the mail stack raises, under one root
mail.addressreading and writing the addresses in a header
mail.headersthe header block, in order and without regard to case
mail.encodingthe encodings a header and a body use
mail.contentContent-Type and Content-Disposition
mail.messagea message, its MIME tree, and building one
mail.dkimsigning a message and checking a signature
mail.saslthe authentication mechanisms all three protocols share
mail.streama line-oriented connection, and negotiating TLS over one
mail.smtpthe sending and receiving ends of SMTP
mail.imapthe client and server ends of IMAP, and where mail is kept
mail.imap.parserthe IMAP grammar
mail.imap.storeMailStore, MaildirStore and MemoryStore
mail.pop3the client end of POP3
mail.poolrunning a mail server on more than one connection at once
Submodule What it is for
test.expectExpect and every matcher on it
test.runnercollecting the declarations and running them
test.reporterReporter, and the seven built-in ones
test.resultCase, Suite, Failure and Summary
test.mockMock, mock() and spy_on()
test.snapshotthe snapshot store and its file format
test.conductdiscovering and running a directory of test files
test.diffstructural equality, and rendering what differs
test.formatrendering any value for a failure message
test.sourcereading a stack trace back to the failing line
test.styleterminal colour, symbols and width
test.errorAssertionError and TestSetupError
test.contextwhat is true while one test is running
Submodule What it is for
validate.validatorsthe one-line entry points, one per rule
validate.validatorValidator, the fluent builder
validate.schemaSchema, validating a whole dictionary at once
validate.ruleRule, the base class custom rules extend
validate.rulesevery built-in rule
Submodule What it is for
wire.compileturning a parsed template into an instruction tree
wire.renderwalking a compiled template and writing the page
wire.expressionthe language between {{ and }}
wire.filtersthe filters every template starts with
wire.escapecontext-aware escaping
wire.loaderresolving the path in an x-include
wire.normalizerewriting the pseudo elements before parsing
wire.valueshow a template reads the values it is given
wire.constantsthe directive names Wire reserves
wire.errorsthe module’s errors, and the locations they carry
Submodule What it is for
zuri.tokentokenize(), and the Token type it returns
zuri.astparse(), and the Node type it returns
zuri.compilecompile(), and the Instr type it returns
zuri.reflectinspecting a live function, class, module or instance
A file in ./.zuri/libs/ shadows a standard library module of the same
name, because that directory is searched first. See
The Module System .