JavaScript Modules
Pure JavaScript modules (lib/*.js) providing polyfills for standard APIs, wrappers around native modules, and prototype extensions.
Complete List
Core & Language Extensions
- util — Central utility library
- iterator — Base iterator class
- asyncIterator — Async iterator base class
Prototype Extensions
- extendArray — Array prototype extensions
- extendArrayBuffer — ArrayBuffer prototype extensions
- extendMap — Map prototype extensions
- extendSet — Set prototype extensions
- extendFunction — Function prototype extensions
- extendAsyncFunction — AsyncFunction prototype extensions
- extendGenerator — Generator prototype extensions
- extendAsyncGenerator — AsyncGenerator prototype extensions
Runtime / Node.js Compatible
- assert — Node.js assert module
- console — WHATWG Console API
- process — Node.js process object
- readline — Node's
readline - readlinePromises —
readline/promises - events — Node.js EventEmitter
- abort — AbortController/AbortSignal
- timers — HTML5 Timers API (setTimeout, setInterval, etc.)
- perf_hooks — Performance hooks
- module — Module utilities,
registerHooks() - bun — the
Bunglobal:Bun.plugin()runtime plugins,Bun.file(),Bun.write() - node — Node compatibility qjsm loads at startup: the
node:/node_modules/CommonJS loaders and Node's globals - loaders/commonjs —
commonjsmodule format loader (registerHooks()) - loaders/file —
with { type: 'file' }imports, as in Bun (registerHooks()) - loaders/typescript —
.tsloader, types stripped by node'smodule.stripTypeScriptTypes(registerHooks()) - loaders/packages —
node_modulesandpackage.jsonexports/imports/main, Node's ESM resolution (registerHooks(), preloaded) - globals — web/Node globals (
URL,structuredClone,crypto,Intl, ...), installed by node - intl —
Intl(ECMA-402) with English data:NumberFormat,DateTimeFormat,PluralRules,Collator,ListFormat,RelativeTimeFormat,Locale - jsonStreams — Deno's
JsonParseStream,ConcatenatedJsonParseStream,JsonStringifyStream - string_decoder — Node's
string_decoder(StringDecoder) - textLineStream — Deno's
TextLineStream - timersPromises —
timers/promises - wasi —
WASI(Node'snode:wasi, preview1), portable: qjsm, node, bun, deno - webassembly — the
WebAssemblyglobal over thewasmmodule (opt-in) - loaders/wasm —
.wasmES module loader (registerHooks(), opt-in) - require — CommonJS require
- stack — Stack utilities
I/O & Filesystem
- fs — Node.js fs module (wraps native modules)
- fsPromises — Promise-based fs API
- io — I/O utilities
- stream — WHATWG Streams API (ReadableStream, WritableStream, TransformStream)
- streams — Stream utilities
- vfs — Virtual filesystem
- glob — glob patterns:
match(), directory scans (Bun.Glob) - json5 —
JSON5.parse/stringify(Bun.JSON5) - jsonc —
JSONC.parse, JSON with comments and trailing commas (Bun.JSONC) - inotify — inotify wrapper
- tty — TTY utilities
- terminal — Terminal utilities
- socklen_t — Socket length type
Node and Bun Parts
- node:buffer —
node:buffer(Buffer,atob,btoa) - node:child_process —
node:child_processover the native module - node:events —
node:events(EventEmitter,once,on) - node:os —
node:os - node:util —
node:util - assertStrict —
assert/strict - bun-util — the
Bun.*utility functions
How much of Node's, Bun's and Deno's surface this adds up to: runtime-compat.
Parsing, DOM & Selectors
- dom — W3C DOM API (wraps native modules)
- xpath — XPath implementation
- parser — Parser combinator framework
- grammar — Grammar utilities
- lex — lex/flex
.lfiles: lexer, parser (AST), generated lexers - grammar-parsers — BNF, EBNF, ANTLR
.g4and yacc/jison files to an AST - parse-ast — parse sources with a grammar file, print the tree as JSON (
utilities/parse-ast.js) - module-lexer — imports and exports of a JS source as records (ES module and CommonJS),
print(),merge() - css3-selectors — CSS3 selector engine
- url — WHATWG URL API (polyfill)
Databases
- sql — Bun
bun:sql-flavored tagged-template client unifying sqlite/pgsql/mysql - db — Database utilities
- database —
bun:sqlite-styleDatabaseandStatementover the sqlite module - dbi — database-independent
Database/Resultover sqlite, mysql and pgsql
Tooling
Utilities
- describe — describeClass()/describeObject(), also a command-line tool that dumps an API in qjsm, node, bun, deno
- c-functions — find C function definitions and prototypes in a source
- magic-string — bundled magic-string: edit a string by index, generate a source map
- tinytest — the zero-dependency test library of
tests/unittests/ - simple-queue — the Chromium
SimpleQueuebehind the streams - file — the WHATWG
File - lazyGlobal — define a global that loads its module on first read
Module Classification
Polyfills (Standalone JS)
Pure JavaScript implementations of standard APIs with no native dependencies:
- WHATWG/W3C/HTML5: events, url, timers, abort, console
- ECMA-402: intl (English only)
- Node.js: assert, fs (partial), process (partial)
- Utilities: iterator, asyncIterator
Wrappers (Wrap Native Modules)
JavaScript code that wraps native modules to provide higher-level APIs:
- fs — Wraps misc, mmap, syscallerror
- fsPromises — Wraps fs
- dom — Wraps fs, util, timers, css3-selectors, deep, pointer, tree-walker, xml, url
- console — Wraps os, util, inspect, std
- process — Wraps os, path, util, misc, std
- assert — Wraps util
- util — Wraps misc, timers
Prototype Extensions
Extend built-in JavaScript prototypes (Array, Object, Map, etc.):
- extendArray, extendArrayBuffer, extendMap, extendSet
- extendFunction, extendAsyncFunction, extendGenerator, extendAsyncGenerator
Statistics
- Total JS modules: 75 files in
lib/, 79 docs - Polyfills: 26 (standalone JS implementations)
- Wrappers: 32 (wrap native modules)
- Extensions: 10 (prototype extensions)
Standards Compliance
- WHATWG/W3C/HTML5: events, url, timers, abort, console, dom
- Node.js: assert, fs, fsPromises, process, events, util
- Custom: Many utility modules (see api-compatibility.md)