1 This is the README for the sqlite3 WASM/JS distribution.
3 Main project page: https://sqlite.org
5 Documentation: https://sqlite.org/wasm
7 This archive contains the following deliverables for the WASM/JS
10 - jswasm/sqlite3.js is the canonical "vanilla JS" version.
12 - jswasm/sqlite3.mjs is the same but in ES6 module form
14 - jswasm/*-bundler-friendly.js and .mjs are variants which are
15 intended to be compatible with "bundler" tools commonly seen in
16 node.js-based projects. Projects using such tools should use those
17 variants, where available, instead of files without the
18 "-bundler-friendly" suffix. Some files do not have separate
21 - jswasm/sqlite3.wasm is the binary WASM file imported by all of the
22 above-listed JS files.
24 - The jswasm directory additionally contains a number of supplemental
25 JS files which cannot be bundled directly with the main JS files
26 but are necessary for certain usages.
28 - The top-level directory contains various demonstration and test
29 applications for sqlite3.js and sqlite3.mjs.
30 sqlite3-bundler-friendly.mjs requires client-side build tools to make
31 use of and is not demonstrated here.
33 Browsers will not serve WASM files from file:// URLs, so the test and
34 demonstration apps require a web server and that server must include
35 the following headers in its response when serving the files:
37 Cross-Origin-Opener-Policy: same-origin
38 Cross-Origin-Embedder-Policy: require-corp
40 The core library will function without those headers but certain
41 features, most notably OPFS storage, will not be available.
43 One simple way to get the demo apps up and running on Unix-style
44 systems is to install althttpd (https://sqlite.org/althttpd) and run:
46 althttpd --enable-sab --page index.html