Compatibility
API support matrix, WebAssembly compatibility, and polyfill status
Overview
NANO is a WinterTC-compatible runtime providing web-standard APIs (fetch, Request, Response) rather than Node.js-specific APIs (fs, path, http).
The nano-compat library provides polyfills for common Node.js patterns requiring backward compatibility.
WebAssembly Support
V8 built-in WASM engine executes binary modules without external dependencies.
const wasmModule = await WebAssembly.compile(wasmBytes);
const instance = await WebAssembly.instantiate(wasmModule, {
env: { memory: new WebAssembly.Memory({ initial: 1 }) }
});
const result = instance.exports.add(1, 2);
Capabilities
- Module Compilation: WebAssembly.compile() for binary validation
- Instantiation: WebAssembly.instantiate() with import objects
- Memory Management: WebAssembly.Memory for linear memory
- Table Imports: WebAssembly.Table for function references
- Source Integrity: Hash-based caching for verification
WinterTC API Matrix
Implementation status of WinterTC standard APIs.
| API | Status | Notes |
|---|---|---|
| fetch() | Complete | Full implementation with streaming |
| Request | Complete | Constructor with method, headers, body |
| Response | Complete | Constructor with status, headers, body |
| Headers | Complete | Map-like interface, case-insensitive |
| URL | Complete | Full URL parsing with all properties |
| URLSearchParams | Complete | Query string manipulation |
| TextEncoder | Complete | UTF-8 encoding to Uint8Array |
| TextDecoder | Complete | UTF-8 decoding from Uint8Array |
| ReadableStream | Complete | Streaming data interface |
| WritableStream | Complete | Output streaming with backpressure |
| crypto.getRandomValues | Complete | All TypedArray types supported |
| crypto.subtle.digest | Complete | SHA-256, SHA-384, SHA-512 |
| crypto.subtle.generateKey | Complete | AES-GCM, HMAC |
| crypto.subtle.encrypt | Complete | AES-GCM with JWK keys |
| WebAssembly | Complete | V8 built-in WASM engine |
| console | Complete | log, error, warn, info, debug |
| setTimeout/setInterval | Complete | Timer functions with clearing |
| atob/btoa | Complete | Base64 encoding/decoding |
| structuredClone | Complete | Deep object cloning |
| WebSocketPair | In Progress | v2.0a — Phase 23. Cloudflare Workers compatible API. |
Node.js Compatibility
Limited Node.js compatibility available via nano-compat polyfills.
| Module | Status | Notes |
|---|---|---|
| assert | Native | WinterTC compatible |
| Buffer | Polyfill | Full implementation via nano-compat |
| fs | Polyfill | VFS-based filesystem (Nano.fs.*) |
| path | Polyfill | Path manipulation utilities |
| crypto (Node) | Not Available | Use WebCrypto crypto.subtle instead |
| http | Not Available | Use WinterTC fetch instead |
| https | Not Available | Use WinterTC fetch instead |
| net | Not Available | Raw sockets not supported |
| stream | Partial | Limited via nano-compat |
| url | Native | WinterTC compatible |
| util | Native | WinterTC compatible |
Framework Compatibility
Verified framework support for WinterTC-compatible JavaScript frameworks.
Hono
Ultra-lightweight web framework
Fully CompatibleAstro
Static site generator with islands
Fully CompatibleNext.js
Static export only (no SSR)
Partialnano-compat Library
Optional polyfills for Node.js APIs not part of WinterTC.
import '@nano-rs/compat';
Buffer
Node.js Buffer implementation with proper toString()
Completepath
Path manipulation and normalization
Completefs
VFS-based filesystem operations
Completetimers
setImmediate, nextTick polyfills
Basic