@spikard/node-wasm
v0.17.1
Published
Codegen-first polyglot web toolkit with a Rust core and bindings for 14 languages
Readme
Spikard WASM — Part of the spikard polyglot web toolkit.
Codegen-first polyglot web toolkit on a Rust core: OpenAPI/AsyncAPI/GraphQL/JSON-RPC/gRPC codegen, SQL-to-HTTP, tower-http middleware, and an MCP server. Experimental, pre-1.0. WebAssembly bindings for browsers, Deno, and Cloudflare Workers.
Install · Quick example · Features · Docs
[!IMPORTANT] spikard is experimental and pre-1.0. APIs change between releases and not every binding is at the same level of maturity, so it is not yet recommended for production. Feedback is genuinely wanted at this stage — open an issue if something is wrong, awkward, or missing.
What this package provides
Browser and server WASM — wasm-bindgen for browsers, Node.js 18+, and Deno 1.0+
Type-safe routing — HTTP definitions with path, query, body, and header validation across all bindings
Spec-driven codegen — OpenAPI 3.0, AsyncAPI 3.0, GraphQL SDL, and JSON-RPC 2.0 support
Cross-language parity — same DTOs, fixtures, and error model prevent runtime drift
Tower middleware — compression, rate limiting, timeouts, auth (JWT/API key), static files
Lifecycle hooks —
onRequest,preValidation,preHandler,onResponse,onError
Installation
npm:
npm install @spikard/node-wasmpnpm:
pnpm add @spikard/node-wasmyarn:
yarn add @spikard/node-wasmSystem Requirements
- Modern browser with WebAssembly support, or Node.js 18+, or Deno 1.0+
Quick example
See the spikard repository for usage examples and guides.
Features
| Feature | Support | |---|---| | Type-safe routing | Path, query, body, and header parameter validation | | Request extraction | Typed structs for JSON, form data, multipart, and raw bodies | | Spec support | OpenAPI 3.0 · AsyncAPI 3.0 · GraphQL SDL · JSON-RPC 2.0 | | Middleware | Compression, rate limiting, timeouts, authentication, static files | | Lifecycle hooks | Request, pre-validation, pre-handler, response, and error hooks | | WebSocket & SSE | Bidirectional streams and server-sent events | | Error handling | Consistent error responses across all bindings via ProblemDetails | | Fixture testing | Shared JSON fixtures for behavioral consistency across languages |
See examples in the repository.
See examples in the repository.
See examples in the repository.
Resources
- Repository — source code, examples, and issues
- Examples — working implementations in all supported languages
- Contributing — how to contribute
License
MIT License — see LICENSE for details.
