@tapirus/wasm-lite
v1.2.1
Published
`@tapirus/wasm` compiles the full Safe-Rust TapirusDB Quad engine (`sql`, `vector`, `graph`, `document`, `ai-memory`, and `XChaCha20-Poly1305` encryption) to WebAssembly via `wasm-bindgen`, exposing JavaScript bindings and the compiled `.wasm` binary insi
Readme
TapirusDB WASM Crate (@tapirus/wasm)
@tapirus/wasm compiles the full Safe-Rust TapirusDB Quad engine (sql, vector, graph, document, ai-memory, and XChaCha20-Poly1305 encryption) to WebAssembly via wasm-bindgen, exposing JavaScript bindings and the compiled .wasm binary inside pkg/.
Key Capabilities
- Native
.tapirInterchange: Open, query, mutate, and export portable.tapirsnapshots directly compatible with the native CLI, Rust core, Python SDK, and Node.js SDK. - End-to-End Encrypted Browser Vaults: Create and restore XChaCha20-Poly1305 encrypted in-memory databases and
.tapirsnapshots directly in JS/WASM usingTapirusWasm.new_encrypted(passphrase),is_encrypted(), andTapirusWasm.import_encrypted_bytes(bytes, passphrase). - Parameterized SQL & Transactions: Execute bound queries (
execute_params,query_params_json) withBEGIN,COMMIT,ROLLBACK, savepoints, CTEs, triggers, and constraints. - Hybrid AI Memory & GraphRAG: Run
store_memory_json,search_memories_json,memory_request_json,graph_rag_query_json,rabitq_quantize_json, and local TAP inference (tap_classify,tap_verify) inside the browser or Node/edge runtimes.
Build & Verify
rustup target add wasm32-unknown-unknown
# Ensure wasm-bindgen-cli matches Cargo.lock, then run from the repository root:
node scripts/build-wasm.js # Full Quad (@tapirus/wasm) -> pkg/
node scripts/build-wasm.js --lite # Ultra-light SQL + Crypto (@tapirus/wasm-lite) -> pkg-lite/
node scripts/test-wasm.mjs
node scripts/test-wasm-lite.mjs
node scripts/test-wasm-package.mjs
node scripts/test-browser-workspace.mjsscripts/build-wasm.jsgenerates@tapirus/wasmincrates/tapirus-wasm/pkg/, or@tapirus/wasm-lite(smaller SQL + transaction + XChaCha20-Poly1305 profile) incrates/tapirus-wasm/pkg-lite/when passed--lite(setWASM_BINDGEN_BINfor a custom CLI path).node scripts/test-wasm-package.mjspacks@tapirus/wasm, installs the tarball offline into a fresh consumer directory, and validates bound SQL, rollback, and snapshot reopen.scripts/package-browser-workspace.jsprepares the standalone browser workspace instudio/public/native(--siteprepares the website Studio entry).
