Skip to content

Standard Library

The standard library is loaded automatically: every package below is available in every script without an import. Call a package’s functions with package::name(...).

Each package page starts with a guide and examples, followed by an API reference generated from the docstrings in lib/*.kiwi.

PackagePurpose
csvParse CSV into lists or hashmaps, with typed columns.
jsonParse and produce JSON.
yamlParse and produce YAML.
xmlParse, query, build and serialize XML.
protobufEncode and decode Protocol Buffers.
encodeBase64, hex and URL encoding.
compressDEFLATE, GZip, Brotli, Zstandard and ZIP.
cryptoMD5, SHA and HMAC hashes; secure random bytes and UUIDs.
PackagePurpose
tableFilter, join, group and display lists of hashmaps.
textLine-oriented text pipelines.
pipelineNamed, step-by-step processing pipelines.
sqliteSQLite databases.
statDescriptive statistics.
mathMathematical functions and random numbers.
collectionsHeap and Set.
iterA cursor for stepping through lists.
fakerRealistic fake data.
PackagePurpose
stringString formatting and inspection, as string methods.
listList predicates and searches, as list methods.
dateDate arithmetic and components, as date methods.
PackagePurpose
fmtprintf-style formatting.
template{{placeholder}} templates.
regexRegular expressions.
consoleTerminal colors, cursor and key input.
cliMessages, tables, prompts and argument parsing for command-line tools.
logLeveled logging.
PackagePurpose
fioRead, write and manage files and directories.
pathThe Path struct.
watchWatch files and directories for changes.
stdinRead standard input.
envEnvironment variables and command-line arguments.
dotenvLoad .env files.
sysRun programs and manage processes.
signalHandle OS signals.
ipcNamed-pipe messaging between processes.
nativeLoad native extensions written in C, C#, Rust or Zig.
ffiCall C functions in shared libraries, and read and write native memory.
PackagePurpose
httpHTTP client.
httpserverHTTP server with routing and middleware.
webThe interface between web apps and the server: composable middleware, mounting, streaming and a test client.
curlHTTP requests through the system curl.
socketTCP and TLS sockets (socket and tls).
udpUDP datagrams.
smtpSend email.
PackagePurpose
taskBackground tasks, channels and mutexes.
timeThe clock, timestamps and calendar helpers.
stopwatchMeasure elapsed time.
PackagePurpose
testerUnit tests.
benchBenchmarks.
errorStructured errors and guards.
reflectorRuntime introspection.
hashableConvert struct instances to hashmaps.
stdSmall general helpers.

Global helpers such as d(), char(), spawn() and await() are on the Global Functions page.