SQLite Wasm conveniently wrapped as an ES Module. Current stable version is 3.42.0-build6. This package provides a zero-dependency, drop-in ES Module wrapper for SQLite's official WebAssembly build, allowing SQLite to run in the browser. Key differentiators: supports both main thread (transient storage) and worker thread (with origin private file system for persistent storage), maintains unmodified upstream code, ships TypeScript types, and requires specific HTTP headers (COOP/COEP) for OPFS support. Released as needed per SQLite version bumps.
npm install sqlite-esmNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows default import, initializing the module, creating an in-memory database, executing SQL, and fetching results.
Set the HTTP headers on the server or in dev server config (e.g., Vite's server.headers).
Add the exclusion in vite.config.js as shown in the README.
Report SQLite bugs upstream at https://www.sqlite.org/src/wiki?name=Bug+Reports
For persistent storage, use the worker thread variant with OpfsDb.
Use sqlite3InitModule({...}).then(sqlite3 => { ... }) or await sqlite3InitModule({...}).Set 'Cross-Origin-Embedder-Policy: require-corp' and 'Cross-Origin-Opener-Policy: same-origin' headers.
Use OpfsDb only in a worker thread with correct HTTP headers.
No dependency data recorded yet.