Compatibility
API support matrix, WebAssembly compatibility, and polyfill status
Overview
NANO speaks three dialects. Your code can use any combination.
Web-standard APIs. Drop-in replacement for Workers code. 100% of the minimum common API surface.
fetch · Request · Response · WebCrypto · streams
Most npm packages that target edge runtimes work out of the box via built-in polyfills.
require('path') · require('buffer') · process.env
localStorage shim built on nano:kv means browser-targeting code runs unmodified.
nano:kv · openKV · localStorage shim
NANO is a WinterTC-compatible runtime. Where Node.js APIs are available they are polyfilled — not at full fidelity, but enough for the common edge patterns. http, net, os, and native addons are out of scope by design.
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. |
nano: Built-in Modules
nano-rs exposes its own APIs under the nano: ESM namespace — clearly distinct from WinterTC and Node.js. Import them in any ESM handler.
import { kv, openKV } from 'nano:kv';
// Default namespace (hostname-scoped, EdgeStore backed)
await kv.set('hits', new TextEncoder().encode('1'));
const val = await kv.get('hits');
const num = await kv.getJSON('counter');
// Named namespace
const cache = openKV('cache');
await cache.setJSON('config', { version: 2 });
const cfg = await cache.getJSON('config');
// List keys by prefix
const entries = await kv.list('user:');
| Module | Status | Notes |
|---|---|---|
| nano:kv | Complete | EdgeStore-backed KV. kv + openKV(name). Hostname-namespaced. Bytes primitive + JSON helpers. |
| nano:localStorage | Planned | JS shim over nano:kv. See examples/localStorage-shim.js for the current userland version. |
| nano:cache | Planned | WinterTC CacheStorage — VFS-backed Response serialization. |
| nano:indexeddb | Phase 3 | Full IndexedDB — backend TBD (SQLite or structured JSON in VFS). |
Node.js Compatibility
Common Node.js modules available via require(). These cover ~80% of npm packages that run in edge runtimes.
const path = require('path');
const { from, isBuffer, concat } = require('buffer');
const assert = require('assert');
const joined = path.join('/var', 'app', 'config.json'); // /var/app/config.json
const dir = path.dirname(joined); // /var/app
const ext = path.extname(joined); // .json
const env = process.env.NODE_ENV; // from host environment
const ver = process.version; // "v18.0.0"
| Module / Global | Status | Notes |
|---|---|---|
| require('path') | Complete | join, dirname, basename, extname, resolve, isAbsolute, normalize, sep, delimiter |
| require('buffer') | Complete | Buffer.from, Buffer.alloc, Buffer.isBuffer, Buffer.concat. Returns Uint8Array. |
| require('assert') | Complete | assert.ok, assert.equal, assert.strictEqual, assert.notEqual |
| require('fs') | Complete | readFileSync, writeFileSync, existsSync, unlinkSync + async variants. VFS-backed. |
| process.env | Complete | App-configured env vars (set via env_vars in config). Never the host process env. process.version = "v18.0.0", process.platform = "linux". |
| require('events') | Planned | EventEmitter — phase 2. |
| require('util') | Planned | util.promisify, util.inspect — phase 2. |
| crypto (Node) | Not Available | Use WebCrypto crypto.subtle instead. |
| http / https / net | Out of Scope | Use WinterTC fetch() for outbound HTTP. |
| child_process | Out of Scope | Sandboxed execution model — no subprocess spawning. |
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)
PartialStorage Architecture
Two distinct storage stacks — file operations and key-value operations are separate systems with different semantics.
File Storage (VFS)
Named file access via require('fs') and Nano.fs.*. Memory or disk backend. Used for static assets and structured files.
require('fs').readFileSync('/data/config.json')
Key-Value Storage (EdgeStore)
Structured KV with namespace isolation via nano:kv. EdgeStore embedded engine. Hostname-prefixed so each app has its own isolated store. S3-compatible replication path available via EdgeStore tiers.
import { kv } from 'nano:kv';