Skip to main content

Runtime reference

Timers​

Global timer functions, behaving like their browser counterparts.

F setTimeout​

setTimeout(callback: (...args: any[]) => void, delay: number, ...args: any[]): number

Runs callback once after delay ms. Returns a timer ID.

F clearTimeout​

clearTimeout(id: number): void

Cancels a pending timeout. Safe to call with an invalid ID.

F setInterval​

setInterval(callback: (...args: any[]) => void, period: number, ...args: any[]): number

Runs callback repeatedly every period ms. Returns a timer ID.

F clearInterval​

clearInterval(id: number): void

Cancels a repeating interval.

F queueMicrotask​

queueMicrotask(callback: () => void): void

Queues callback as a microtask, before the next timer/IO callback.


O console​

All output is forwarded to the daemon event stream and, if a PTY is attached, written directly to it. Arguments are space-joined. No %s / %d printf-style substitution.

F console.log​

log(...args: any[]): void

Logs at INFO level.

F console.info​

info(...args: any[]): void

Logs at INFO level.

F console.warn​

warn(...args: any[]): void

Logs at WARN level.

F console.error​

error(...args: any[]): void

Logs at ERROR level.

F console.debug​

debug(...args: any[]): void

Logs at DEBUG level.

F console.assert​

assert(condition: boolean, ...args: any[]): void

Logs at ERROR level if condition is falsy. No-op otherwise.

F console.clear​

clear(): void

Sends ANSI clear-screen.

F console.count​

count(label?: string): void

Increments and prints a named counter.

F console.countReset​

countReset(label?: string): void

Resets the named counter.

F console.dir​

dir(obj: any): void

Pretty-prints an object.

F console.group​

group(...args: any[]): void

Logs and increases the indent level.

F console.groupEnd​

groupEnd(): void

Decreases the indent level.

F console.table​

table(data: any[] | Record<string, any>): void

Formats an array or object as an ASCII table.

F console.time​

time(label?: string): void

Starts a named timer.

F console.timeLog​

timeLog(label?: string): void

Logs elapsed time without stopping the timer.

F console.timeEnd​

timeEnd(label?: string): void

Logs elapsed time and stops the timer.

F console.trace​

trace(...args: any[]): void

Logs "Trace: ..." with optional args.


V8 built-ins​

All standard ECMAScript built-ins are available: Array, Object, Map, Set, WeakMap, WeakSet, Promise, Proxy, Reflect, Symbol, BigInt, RegExp, Date, Error, JSON, Math, ArrayBuffer, TypedArrays, DataView, WeakRef, FinalizationRegistry, structuredClone, globalThis.

No ICU

This V8 build is compiled without ICU. The Intl.* namespace is unsafe to use. In particular, String.prototype.localeCompare throws RangeError: Internal error. Icu error. Use plain < / > comparisons for sorting and format numbers/dates manually.


What is NOT available​

Node.js / Deno APIs​

Missing APINotes
processNo process.env, process.argv, process.exit(), etc. Use yeet.args for arguments.
require()Use import / ES modules only.
__dirname / __filenameNot defined.
BufferUse Uint8Array / ArrayBuffer.
fsNo file system access.
path / osNot available.
child_process / execNo subprocess spawning.
net / http / httpsNo socket or HTTP APIs.
setImmediateUse queueMicrotask() or setTimeout(fn, 0).
performanceNo performance.now().

Browser APIs​

Missing APINotes
fetchNo HTTP client. Data comes through yeet.graph.
WebSocketNot available.
crypto / SubtleCryptoNot available.
TextEncoder / TextDecoderNot present. For string → bytes, use toUTF8 / toUTF16 / toUTF32 from yeet:tui:text.
URL / URLSearchParamsNot present.
AbortController / AbortSignalNot present.
Event / EventTargetNo DOM event system.
Worker / SharedArrayBuffer / AtomicsNo threading.
localStorage / sessionStorageNot available.
document / DOMNo DOM.
requestAnimationFrameUse setInterval.
XMLHttpRequest / FormData / BlobNot present.
ReadableStream / WritableStreamNo WHATWG streams.