Standard library
This page is not available in the selected language. You are viewing the English documentation for the same version.
0.0.18 snapshot Documentation
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.
Data and collections
Section titled “Data and collections”| 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 |
Files, time and networking
Section titled “Files, time and networking”| 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 |
Databases and developer tools
Section titled “Databases and developer tools”| Module | Purpose |
|---|---|
| pg / redis / mysql | Database clients, pools and detached results |
| lexer / parser | Lexer and parser debugging summaries |
Imports
Section titled “Imports”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.
T! is a Result that may contain an Error. Propagate it with ? or handle it with try/catch. 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.