WebAssembly SDK
Experimental WebAssembly bindings for browser environments.
Status
Section titled “Status”Experimental - API may change.
Installation
Section titled “Installation”npm install @redlite/wasmQuick Start
Section titled “Quick Start”import init, { Redlite } from '@redlite/wasm';
async function main() { await init();
// Create in-memory database const db = new Redlite();
// String operations db.set('key', 'value'); const val = db.get('key'); console.log(val); // "value"
// Hash operations db.hset('user:1', 'name', 'Alice'); const name = db.hget('user:1', 'name');
// List operations db.lpush('queue', 'job1', 'job2'); const job = db.rpop('queue');
db.close();}
main();Limitations
Section titled “Limitations”- In-memory only (no persistence in browser)
- Single-threaded
- Limited to ~2GB memory (WASM limitation)
Building from Source
Section titled “Building from Source”cd sdks/redlite-wasmwasm-pack build --target web