Standard library
Familiar, conventional APIs — the names you already know
(fs.readFileSync, path.join, process.cwd) —
but statically typed and compiled to native code. Every member is type- and
arity-checked before it lowers.
Available now
console
| API | Type |
console.log(x) | any → void |
console.error(x) | any → void |
Math
| API | Type |
Math.abs(n) | number → number |
Math.max(a, b) · Math.min(a, b) | (number, number) → number |
Math.sign(n) | number → int |
Math.clamp(n, lo, hi) | (number, number, number) → number |
Math.sqrt(n) | number → number |
String
| API | Type |
s.length · s + t | int · concatenation |
String.isEmpty(s) | string → bool |
String.contains(s, sub) | (string, string) → bool |
String.startsWith(s, prefix) | (string, string) → bool |
Array
| API | Type |
a[i] · a.length | element access · int |
Array.isEmpty(a) | T[] → bool |
Errors
| API | Notes |
Error("message") · throw e | throw an error value |
try { … } catch (e) { … } finally { … } | e.message holds the message |
fs · process
| API | Type | Notes |
fs.readFileSync(path, encoding?) | (string, string?) → string | UTF-8 text; "" if unreadable |
argsCount() · arg(i) | → int · int → string | process arguments |
Planned
The surface grows in explicit, conformance-backed slices. These
modules use the same conventional names; some depend on upcoming language
features (noted below).
fs
| API | Notes |
fs.writeFileSync(path, data) | |
fs.appendFileSync(path, data) | |
fs.existsSync(path) | → bool |
fs.mkdirSync(path, recursive?) | |
fs.rmSync(path) · fs.unlinkSync(path) | |
fs.renameSync(a, b) · fs.copyFileSync(a, b) | |
fs.statSync(path) → { size, isFile, isDirectory } | record return |
fs.readdirSync(path) → string[] | needs growable arrays |
path
| API | Notes |
path.join(a, b, …) · path.resolve(…) | |
path.basename(p) · path.dirname(p) · path.extname(p) | |
path.isAbsolute(p) · path.sep | |
process
| API | Notes |
process.cwd() | → string |
process.exit(code) | |
process.env(key) | → string | null |
process.platform · process.arch | compile-time constants |
process.argv → string[] | needs growable arrays |
os
| API | Notes |
os.platform() · os.arch() | |
os.tmpdir() · os.homedir() | |
os.cpus() · os.hostname() | |
Math · String · Array (more)
| API | Notes |
Math.floor/ceil/round/trunc/pow/log/sin/cos · Math.PI | |
s.toUpperCase/toLowerCase/trim/replace/indexOf/slice | |
s.split(sep) → string[] | needs growable arrays |
a.map/filter/reduce/forEach(fn) | uses closures |
a.push/pop/sort | needs growable arrays |
time · crypto · http
| API | Notes |
time.now() · time.monotonic() | milliseconds |
crypto.sha256(data) · crypto.sha1(data) | → hex string |
http.get(url) → { status, body } | record return |
async fs / http / timers | needs the async runtime |
Lumen is statically typed and has no dynamic JSON value —
JSON.parse<T> and generic containers (Map,
Set) arrive with generics. This is not a package manager; the
library is a fixed, contracted surface.