Skip to content
English

Standard library

This page is not available in the selected language. You are viewing the English documentation for the same version.

The standard library ships with Ku. Import modules through std; no separate package installation is required. Each reference describes interfaces, return values, errors and examples.

Module Purpose
string Unicode strings, search, slicing and replacement
array Array access, composition and mapping
object String-keyed objects, fields and defaults
json JSON encoding, decoding and dynamic values
Module Purpose
fs UTF-8 file I/O and directory listings
time Timestamps, dates, formatting, durations and waiting
config .env and YAML configuration
http HTTP clients, routes, requests and responses
bytes Binary buffers
net TCP and TLS clients
Module Purpose
pg / redis / mysql Database clients, pools and detached results
lexer / parser Lexer and parser debugging summaries
import json from "std.json"
import { http, time } from "std"

Examples import their dependencies explicitly. Databases, bytes and net currently require native C. See each module and the support matrix for backend availability.

A return type T! denotes Result. After a call, ? extracts success or propagates the error; inside try, that error can be handled by catch. Calls returning ordinary values such as int or str do not use ?. See error handling. An & parameter borrows read-only without consuming or implicitly copying its input. Allocating a new output string or array is separate from copying an input.

Browse the task-oriented examples or learn to write your own library in packages and modules. std.task is an internal observation interface; applications use async fn and await, described in the concurrency guide.