The standard library#
Temper's standard library, std, comes with Temper, and every backend
supports it. Each of its modules is imported by path:
let { Date } = import("std/temporal");
console.log(new Date(2000, 12, 31).toString()); //!outputs "2000-12-31"
// ✅
| Module | What it's for |
|---|---|
std/json |
Converting values to and from JSON, with @json |
std/regex |
Regular expressions, from literals or built as data |
std/temporal |
Calendar dates |
std/testing |
What test blocks run on |
std/net |
Simple HTTP requests |
What's always available without an import, such as String, List,
Map, and console, is in the language reference:
types and values and
builtins.
The library is written in literate Temper, so its sources are its
fullest documentation; tempest builds in a copy of them, from
vendor/temper/std/. On each
backend, some of it connects to the language's own types and
functions (Date is a java.time.LocalDate in Java, for example);
@connected marks those.
These pages are short summaries, written for this repository from the
sources; the old documentation site had no std reference beyond the
regular expressions tutorial.