Modules Overview
VaelJS exposes a canonical, explicit module surface across both the full V8 runtime (vjs) and the QuickJS runtime (vjs-lite). Built-in modules use the vael:* scheme, and opt-outable Node.js automation compatibility modules use the node:* scheme.
| Added in | Runtimes | Cargo Feature |
|---|---|---|
v0.0.0-alpha.0 |
vjs (V8: 75 modules) & vjs-lite (QuickJS: 54 modules) |
Per-module features (enabled by default; --no-default-features to strip) |
Canonical vael:* Specifier Rules
Section titled “Canonical vael:* Specifier Rules”Every VaelJS built-in module requires its exact vael:* specifier (for example "vael:fs" or "vael:uuid/v4"). Bare specifiers such as "fs", "path", or "crypto" are never silently aliased to vael:* modules.
import { readTextFile } from "vael:fs";import { v7 } from "vael:uuid/v7";
const id = v7();const config = readTextFile("./vael.jsonc");console.log(id, config.length);Ambient Globals (Vael & console)
Section titled “Ambient Globals (Vael & console)”Both runtimes install only two ambient globals — Vael and console — with no browser or legacy host globals. See the full Globals Reference for exact TypeScript interfaces and Vael.getBuiltInModule() mappings.
Generating TypeScript Declarations (types)
Section titled “Generating TypeScript Declarations (types)”Both vjs and vjs-lite embed profile-accurate .d.ts declarations (vaeljs-dts) for IDE support and type checking.
# Emit a single self-contained .d.ts bundle to stdoutvjs types > vjs.d.tsvjs-lite types > vjs-lite.d.ts
# Cross-generate the other profile's declarationsvjs types --profile lite > vjs-lite.d.tsvjs-lite types --profile v8 > vjs.d.ts
# Materialize the full types/ directory (index.d.ts, globals.d.ts, vael/*, node/*)vjs types --out-dir ./typesvael:* Standard Library (36 Modules)
Section titled “vael:* Standard Library (36 Modules)”| Specifier | vjs (V8) |
vjs-lite (QuickJS) |
Summary | Since |
|---|---|---|---|---|
vael:age |
Yes | No | X25519 binary age v1 encryption, decryption, and keypair utilities. | 0.0.0-alpha.0 |
vael:amqp |
Yes | No | Async AMQP 0-9-1 messaging client (vael:amqp). |
0.0.0-alpha.2 |
vael:ansi |
Yes | Yes | Terminal ANSI escape sequences, SGR text styling, cursor and screen control, OSC 8 hyperlinks, synchronized output, and ANSI-aware text l… | 0.0.0-alpha.2 |
vael:archive |
Yes | Yes | Hardened archive creation, listing, reading, and extraction (tar, tar.gz, tar.zst, zip). |
0.0.0-alpha.2 |
vael:assert |
Yes | Yes | Structural equality, identity, error, and rejection assertions. | 0.0.0-alpha.0 |
vael:chars |
Yes | Yes | Unicode scalar character classification and single-code-point case conversion predicates. | 0.0.0-alpha.0 |
vael:console |
Yes | Yes | Standard console output methods mirroring globalThis.console. |
0.0.0-alpha.0 |
vael:cron |
Yes | No | UTC five-field cron scheduler and next-occurrence calculator. | 0.0.0-alpha.0 |
vael:crypto |
Yes | Yes | Symmetric AES-256 encryption, SHA-2 hashes/HMACs, PBKDF2, bcrypt, and Shamir secret sharing. | 0.0.0-alpha.0 |
vael:db |
Yes | No | Zero-ORM fluent SQL query builder, safe tagged templates, savepoints, rich SQL types, and strict JSON configuration for vael:db. |
0.0.0-alpha.0 |
vael:db/migrate |
Yes | No | Deterministic SQL migration loader, dry-run planner, multi-driver runner, and reconciliation API for vael:db/migrate. |
0.0.0-alpha.2 |
vael:exec |
Yes | Yes | Argv-only subprocess execution, PATH executable lookup, and OS advisory file locking. | 0.0.0-alpha.2 |
vael:fetch |
Yes | Yes | SSRF-hardened HTTP/HTTPS client and streaming atomic file downloader. | 0.0.0-alpha.2 |
vael:fmt |
Yes | Yes | Cross-runtime string formatting (sprintf, printf), value inspection (inspect), and ANSI escape code stripping (stripAnsiCode). |
0.0.0-alpha.2 |
vael:fmt/bytes |
Yes | Yes | Human-readable byte and bit size formatting. | 0.0.0-alpha.2 |
vael:fmt/duration |
Yes | Yes | Human-readable millisecond duration formatting. | 0.0.0-alpha.2 |
vael:fmt/inspect |
Yes | Yes | Human-readable value inspection for debugging and diagnostic output. | 0.0.0-alpha.2 |
vael:fmt/printf |
Yes | Yes | POSIX and Go-inspired sprintf/printf formatting and stdout helpers. |
0.0.0-alpha.2 |
vael:fmt/strip-ansi-code |
Yes | Yes | Strip ANSI escape sequences from strings. | 0.0.0-alpha.2 |
vael:fs |
Yes | Yes | Bounded synchronous filesystem operations and atomic file writes. | 0.0.0-alpha.0 |
vael:fs/acl |
Yes | Yes | Cross-platform POSIX permission modes, POSIX.1e ACLs, Windows DACLs, and extended attributes (xattr). |
0.0.0-alpha.2 |
vael:http |
Yes | No | Go-style HTTP/1.1 server, ServeMux router, middleware, and immutable request/response types. | 0.0.0-alpha.0 |
vael:nats |
Yes | No | Async NATS messaging and JetStream client (vael:nats). |
0.0.0-alpha.2 |
vael:os |
Yes | Yes | Operating system target constants and host OS release metadata. | 0.0.0-alpha.0 |
vael:os/dirs |
Yes | Yes | Cross-platform user directories, XDG Base Directory Specification paths, and .NET SpecialFolder resolution. |
0.0.0-alpha.2 |
vael:path |
Yes | Yes | Lexical POSIX and Windows path manipulation utilities. | 0.0.0-alpha.0 |
vael:redis |
Yes | No | Async Redis client, commands, and Pub/Sub subscriptions (vael:redis). |
0.0.0-alpha.2 |
vael:slices |
Yes | Yes | Mutable and read-only live views over arrays, typed arrays, and Unicode code-point slices. | 0.0.0-alpha.0 |
vael:ssh |
Yes | Yes | Synchronous SSH command execution and native SFTP (conn.sftp.*) with mandatory host-key verification. |
0.0.0-alpha.0 |
vael:stdio |
Yes | No | Bounded synchronous byte readers, writers, and standard output streams. | 0.0.0-alpha.0 |
vael:strings |
Yes | Yes | Unicode 16.0 case-folding string comparisons and code-point trimming. | 0.0.0-alpha.0 |
vael:template |
Yes | Yes | Go text/template engine with Sprig helpers, template sets, and HTML escaping. |
0.0.0-alpha.0 |
vael:test |
Yes | Yes | Sequential registration-based test runner and reporting API. | 0.0.0-alpha.0 |
vael:uuid |
Yes | Yes | RFC 9562 UUID v4 and v7 generators backed by the operating system CSPRNG. | 0.0.0-alpha.0 |
vael:uuid/v4 |
Yes | Yes | RFC 9562 version 4 (random) UUID generator. | 0.0.0-alpha.0 |
vael:uuid/v7 |
Yes | Yes | RFC 9562 version 7 (Unix-time-ordered + random) UUID generator. | 0.0.0-alpha.0 |
node:* Compatibility Modules (39 Modules)
Section titled “node:* Compatibility Modules (39 Modules)”All node:* modules require the node-compat Cargo feature (enabled by default) and can be disabled at runtime with --no-node-compat.
| Specifier | vjs (V8) |
vjs-lite (QuickJS) |
Summary | Since |
|---|---|---|---|---|
node:assert |
Yes | Yes | Node-compatible assertion utilities (node:assert). |
0.0.0-alpha.2 |
node:assert/strict |
Yes | Yes | Node-compatible strict-mode assertion utilities (node:assert/strict). |
0.0.0-alpha.2 |
node:async_hooks |
Yes | No | Node-compatible async context propagation (AsyncLocalStorage, AsyncResource, executionAsyncId, triggerAsyncId) (node:async_hooks). |
0.0.0-alpha.2 |
node:buffer |
Yes | Yes | Node-compatible Buffer implementation backed by Uint8Array. |
0.0.0-alpha.0 |
node:child_process |
Yes | Yes | Node-compatible synchronous and async child process execution without a shell. | 0.0.0-alpha.0 |
node:console |
Yes | Yes | Node-compatible Console class and formatted console logging utilities (node:console). |
0.0.0-alpha.2 |
node:crypto |
Yes | Yes | Node-compatible cryptographic hashes, HMACs, CSPRNG, PBKDF2, and constant-time comparison. | 0.0.0-alpha.0 |
node:diagnostics_channel |
Yes | Yes | Node-compatible diagnostics channels for publishing and subscribing to named diagnostic message streams (node:diagnostics_channel). |
0.0.0-alpha.2 |
node:dns |
Yes | No | Node-compatible DNS name resolution and Resolver APIs (node:dns). |
0.0.0-alpha.2 |
node:dns/promises |
Yes | No | Node-compatible promise-based DNS resolution and Resolver APIs (node:dns/promises). |
0.0.0-alpha.2 |
node:events |
Yes | Yes | Node-compatible event emitter, async event helpers, and abort listener utilities. | 0.0.0-alpha.2 |
node:fs |
Yes | Yes | Node-compatible synchronous and promise-based filesystem operations. | 0.0.0-alpha.0 |
node:fs/promises |
Yes | No | Node-compatible promise-based filesystem operations. | 0.0.0-alpha.0 |
node:http |
Yes | No | Node-compatible HTTP/1.1 client and server APIs (node:http). |
0.0.0-alpha.2 |
node:https |
Yes | No | Node-compatible HTTPS (HTTP/1.1 over TLS) client and server APIs (node:https). |
0.0.0-alpha.2 |
node:module |
Yes | Yes | Node-compatible module metadata and CommonJS loader helpers (node:module). |
0.0.0-alpha.2 |
node:net |
Yes | No | Node-compatible TCP/IPC servers, sockets, and IP address utilities (node:net). |
0.0.0-alpha.2 |
node:os |
Yes | Yes | Node-compatible operating system metadata utilities. | 0.0.0-alpha.0 |
node:path |
Yes | Yes | Node-compatible filesystem path manipulation utilities. | 0.0.0-alpha.0 |
node:path/posix |
Yes | Yes | Node-compatible POSIX path manipulation utilities (node:path/posix). |
0.0.0-alpha.0 |
node:path/win32 |
Yes | Yes | Node-compatible Windows path manipulation utilities (node:path/win32). |
0.0.0-alpha.0 |
node:perf_hooks |
Yes | Yes | Node-compatible high-resolution timing and performance measurement utilities (node:perf_hooks). |
0.0.0-alpha.2 |
node:process |
Yes | Yes | Node-compatible process metadata, environment variables, working directory, and exit control. | 0.0.0-alpha.0 |
node:querystring |
Yes | Yes | Node-compatible URL query string parsing and serialization (node:querystring). |
0.0.0-alpha.2 |
node:readline |
Yes | No | Node-compatible line-by-line readable stream interface and cursor helpers (node:readline). |
0.0.0-alpha.2 |
node:readline/promises |
Yes | No | Node-compatible promise-based readline interface and buffered cursor helper (node:readline/promises). |
0.0.0-alpha.2 |
node:stream |
Yes | Yes | Node-compatible streaming abstractions (Stream, Readable, Writable, Duplex, Transform, PassThrough, pipeline, finished… |
0.0.0-alpha.2 |
node:stream/consumers |
Yes | Yes | Node-compatible stream consumption utilities (node:stream/consumers). |
0.0.0-alpha.2 |
node:stream/promises |
Yes | Yes | Node-compatible promise-based stream helpers (node:stream/promises). |
0.0.0-alpha.2 |
node:stream/web |
Yes | Yes | Node-compatible WHATWG Streams API (node:stream/web). |
0.0.0-alpha.2 |
node:string_decoder |
Yes | Yes | Node-compatible incremental multi-byte character decoder (node:string_decoder). |
0.0.0-alpha.2 |
node:timers |
Yes | No | Node-compatible callback and promise timer utilities (node:timers). |
0.0.0-alpha.2 |
node:timers/promises |
Yes | No | Node-compatible promise-based timer utilities (node:timers/promises). |
0.0.0-alpha.2 |
node:tls |
Yes | No | Node-compatible TLS/SSL encrypted sockets, servers, and certificate utilities (node:tls). |
0.0.0-alpha.2 |
node:tty |
Yes | Yes | Node-compatible TTY detection and terminal stream classes (node:tty). |
0.0.0-alpha.2 |
node:url |
Yes | Yes | Node-compatible WHATWG URL, URLSearchParams, and file:// path conversion helpers. |
0.0.0-alpha.0 |
node:util |
Yes | Yes | Node-compatible formatting, inspection, promisification, CLI argument parsing, VT/ANSI helpers, and UTF-8 text encoding utilities. | 0.0.0-alpha.2 |
node:util/types |
Yes | Yes | Node-compatible runtime type-checking predicates (node:util/types). |
0.0.0-alpha.2 |
node:zlib |
Yes | Yes | Node-compatible synchronous, callback, and streaming zlib compression (node:zlib). |
0.0.0-alpha.2 |
