{"_id":"@7mind.io/sqlcipher-wasm","_rev":"10-77b20b20595c7bd81785c226d3745a8a","name":"@7mind.io/sqlcipher-wasm","dist-tags":{"latest":"1.2.0"},"versions":{"1.0.0":{"name":"@7mind.io/sqlcipher-wasm","version":"1.0.0","keywords":["sqlcipher","sqlite","wasm","webassembly","database","sql","browser","offline","cross-platform","emscripten"],"author":{"name":"Your Name","email":"your.email@example.com"},"license":"MIT","_id":"@7mind.io/sqlcipher-wasm@1.0.0","maintainers":[{"name":"pshirshov","email":"pshirshov@gmail.com"}],"homepage":"https://github.com/7mind/sqlcipher-wasm#readme","bugs":{"url":"https://github.com/7mind/sqlcipher-wasm/issues"},"dist":{"shasum":"920a569027317e4131b689580b5c14e38e1c751b","tarball":"https://registry.npmjs.org/@7mind.io/sqlcipher-wasm/-/sqlcipher-wasm-1.0.0.tgz","fileCount":6,"integrity":"sha512-ExxPy+QkvwPGUpcKZUtX0ZS/0gpmpTpZABUd4DMUih4Dwiv5wG75485KoWeWYXVJ6TRMy/g0mcYVS8eFfpgTow==","signatures":[{"sig":"MEUCIF93flQm2IoPhIEp+XVQPUTE804DbXbGmVfC7eMdykpRAiEAu04GHyQT5nQz4PF3ebWmTfX+HyuTApvHrqR6Yip+1HE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2347511},"main":"dist/sqlcipher.js","types":"lib/sqlite-api.d.ts","engines":{"node":">=14.0.0"},"gitHead":"9624d641edcb80edeb3cfbbcb988f45c3df42b89","scripts":{"test":"node test/test.cjs","bench":"node bench/benchmark.cjs","build":"./build.sh","test:all":"npm test && npm run test:e2e && npm run test:file","test:e2e":"node test/e2e-test.cjs","test:file":"node test/file-db-test.cjs","test:watch":"nodemon --watch test --watch dist test/test.cjs","prepublishOnly":"./build.sh","test:cross-platform":"node test/cross-platform-db-test.cjs","prepare:cross-platform":"./tools/prepare-cross-platform-test.sh"},"_npmUser":{"name":"pshirshov","email":"pshirshov@gmail.com"},"repository":{"url":"git+https://github.com/7mind/sqlcipher-wasm.git","type":"git"},"_npmVersion":"10.8.2","description":"SQLite/SQLCipher WebAssembly build with high-level JavaScript API, comprehensive tests, and cross-platform compatibility","directories":{},"_nodeVersion":"20.19.5","_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/sqlcipher-wasm_1.0.0_1762021358947_0.3614602071211175","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@7mind.io/sqlcipher-wasm","version":"1.0.3","keywords":["sqlcipher","sqlite","wasm","webassembly","database","sql","browser","offline","cross-platform","emscripten"],"author":{"name":"Your Name","email":"your.email@example.com"},"license":"MIT","_id":"@7mind.io/sqlcipher-wasm@1.0.3","maintainers":[{"name":"pshirshov","email":"pshirshov@gmail.com"}],"homepage":"https://github.com/7mind/sqlcipher-wasm#readme","bugs":{"url":"https://github.com/7mind/sqlcipher-wasm/issues"},"dist":{"shasum":"1a6d8d3eb830ea65d51a13725b8ea06a0e69f70b","tarball":"https://registry.npmjs.org/@7mind.io/sqlcipher-wasm/-/sqlcipher-wasm-1.0.3.tgz","fileCount":6,"integrity":"sha512-CDEN6tyVGkeiAZBfnkjBIjkm02CAD4IaghkAC4b5PlTlDjPcAAoP/4Ly4ltsxGwPcMB88ASinG+ieiGEwSX6JA==","signatures":[{"sig":"MEUCIFTxhNrsotH9RY8UzRkG7oV6C0domqaCwrMFlg+N8xAvAiEAwy30EAXuxwBbKch4aew6tV4iEXW+tNl7frsSmryhJDw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@7mind.io%2fsqlcipher-wasm@1.0.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":2895212},"main":"dist/sqlcipher.js","types":"lib/sqlite-api.d.ts","engines":{"node":">=14.0.0"},"gitHead":"945f50d73f277eed5bca85e71f47acec3a584d81","scripts":{"test":"node test/run-all-tests.cjs","bench":"node bench/benchmark.cjs","build":"./build.sh","test:watch":"nodemon --watch test --watch dist test/run-all-tests.cjs","prepublishOnly":"./build.sh"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:af2fd1d7-9d20-45f8-b95e-d03d653be7b3"}},"repository":{"url":"git+https://github.com/7mind/sqlcipher-wasm.git","type":"git"},"_npmVersion":"11.6.1","description":"SQLite/SQLCipher WebAssembly build with high-level JavaScript API, comprehensive tests, and cross-platform compatibility","directories":{},"_nodeVersion":"24.11.0","_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/sqlcipher-wasm_1.0.3_1762028564082_0.17129638604199027","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@7mind.io/sqlcipher-wasm","version":"1.0.4","keywords":["sqlcipher","sqlite","wasm","webassembly","database","sql","browser","offline","cross-platform","emscripten"],"author":{"name":"Your Name","email":"your.email@example.com"},"license":"MIT","_id":"@7mind.io/sqlcipher-wasm@1.0.4","maintainers":[{"name":"pshirshov","email":"pshirshov@gmail.com"}],"homepage":"https://github.com/7mind/sqlcipher-wasm#readme","bugs":{"url":"https://github.com/7mind/sqlcipher-wasm/issues"},"dist":{"shasum":"295e025ecc0a260169ffabca9e9184c5685d93cd","tarball":"https://registry.npmjs.org/@7mind.io/sqlcipher-wasm/-/sqlcipher-wasm-1.0.4.tgz","fileCount":6,"integrity":"sha512-BF8vXoARnY1FXzbHUXMl71slZlgebb/2gYDGHn/2RM2JLD+kiEi7zmEPJLDOvwtChPyA5KfHj3eiBeDC6gGz5g==","signatures":[{"sig":"MEUCIA3/9UZhGvjlhxIRuXj+sm40LMVvXId3DIaxIGBnKc0oAiEAtA/A3CKG+A0SOQ61FiUWGJnF7xAJiniKUuyCqlB9mz4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@7mind.io%2fsqlcipher-wasm@1.0.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":2895212},"main":"dist/sqlcipher.js","types":"lib/sqlite-api.d.ts","engines":{"node":">=14.0.0"},"gitHead":"9bb7acdc7c0a3d351e6af3d75ea45011c3b0cd03","scripts":{"test":"node test/run-all-tests.cjs","bench":"node bench/benchmark.cjs","build":"./build.sh","test:watch":"nodemon --watch test --watch dist test/run-all-tests.cjs","prepublishOnly":"./build.sh"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:af2fd1d7-9d20-45f8-b95e-d03d653be7b3"}},"repository":{"url":"git+https://github.com/7mind/sqlcipher-wasm.git","type":"git"},"_npmVersion":"11.6.1","description":"SQLite/SQLCipher WebAssembly build with high-level JavaScript API, comprehensive tests, and cross-platform compatibility","directories":{},"_nodeVersion":"24.11.0","_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/sqlcipher-wasm_1.0.4_1762029178274_0.5699807508432408","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"@7mind.io/sqlcipher-wasm","version":"1.0.5","keywords":["sqlcipher","sqlite","wasm","webassembly","database","sql","browser","offline","cross-platform","emscripten"],"author":{"name":"Your Name","email":"your.email@example.com"},"license":"MIT","_id":"@7mind.io/sqlcipher-wasm@1.0.5","maintainers":[{"name":"pshirshov","email":"pshirshov@gmail.com"}],"homepage":"https://github.com/7mind/sqlcipher-wasm#readme","bugs":{"url":"https://github.com/7mind/sqlcipher-wasm/issues"},"dist":{"shasum":"adeae377553cb344cb70803976f97f32bb4d5e15","tarball":"https://registry.npmjs.org/@7mind.io/sqlcipher-wasm/-/sqlcipher-wasm-1.0.5.tgz","fileCount":6,"integrity":"sha512-wuPbhjLTPIjNvJFeP0zfszkukgc86O7KXG+oL4iHc+qByHroodWbpBw+QfiSeYWJ329nyD8Zrgb1ppuEMzYwLA==","signatures":[{"sig":"MEUCIQCO/5JyLW3Aj3OYjbHr+zm8V8KeMTdzNLja5rSQlrGPSwIgef0L7MEngnznM8V1qMcW6vA2cIis5/5F/I5y1Wiz5mU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@7mind.io%2fsqlcipher-wasm@1.0.5","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":2898702},"main":"dist/sqlcipher.js","types":"lib/sqlite-api.d.ts","engines":{"node":">=14.0.0"},"gitHead":"e447c6414b49dce406050b166cd013790b4ddf52","scripts":{"test":"node test/run-all-tests.cjs","bench":"node bench/benchmark.cjs","build":"./build.sh","test:watch":"nodemon --watch test --watch dist test/run-all-tests.cjs","prepublishOnly":"./build.sh"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:af2fd1d7-9d20-45f8-b95e-d03d653be7b3"}},"repository":{"url":"git+https://github.com/7mind/sqlcipher-wasm.git","type":"git"},"_npmVersion":"11.6.1","description":"SQLite/SQLCipher WebAssembly build with high-level JavaScript API, comprehensive tests, and cross-platform compatibility","directories":{},"_nodeVersion":"24.11.0","_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/sqlcipher-wasm_1.0.5_1762029905531_0.8402944585205316","host":"s3://npm-registry-packages-npm-production"}},"1.0.7":{"name":"@7mind.io/sqlcipher-wasm","version":"1.0.7","keywords":["sqlcipher","sqlite","wasm","webassembly","database","sql","browser","offline","cross-platform","emscripten"],"author":{"name":"Your Name","email":"your.email@example.com"},"license":"MIT","_id":"@7mind.io/sqlcipher-wasm@1.0.7","maintainers":[{"name":"pshirshov","email":"pshirshov@gmail.com"}],"homepage":"https://github.com/7mind/sqlcipher-wasm#readme","bugs":{"url":"https://github.com/7mind/sqlcipher-wasm/issues"},"dist":{"shasum":"6b797243164d463f996e2329897e83d9ad7f7d4a","tarball":"https://registry.npmjs.org/@7mind.io/sqlcipher-wasm/-/sqlcipher-wasm-1.0.7.tgz","fileCount":6,"integrity":"sha512-a6iQRkutS29PYvNwnuSGLAHB3+91P+JK+MbfhKsxCEzW0B1WEUnBga7nzZNATqna9vXoTPJ6on4RcZBrRGWbmg==","signatures":[{"sig":"MEUCIQDcB7ozRvS5h7c3VSvae9QPOV8fGeGpcej/HKD3YTguIQIgE9w8eSbdn582WXyq23rgQB0i8iyXj+2ya+eHd2sV2WY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@7mind.io%2fsqlcipher-wasm@1.0.7","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":2898702},"main":"dist/sqlcipher.js","types":"lib/sqlite-api.d.ts","engines":{"node":">=14.0.0"},"gitHead":"c09e8dafb773fa974968261f99ea833bffa46714","scripts":{"test":"node test/run-all-tests.cjs","bench":"node bench/benchmark.cjs","build":"./build.sh","test:watch":"nodemon --watch test --watch dist test/run-all-tests.cjs","prepublishOnly":"./build.sh"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:0ad2997d-1b52-4a36-b465-57e9947662e9"}},"repository":{"url":"git+https://github.com/7mind/sqlcipher-wasm.git","type":"git"},"_npmVersion":"11.6.1","description":"SQLite/SQLCipher WebAssembly build with high-level JavaScript API, comprehensive tests, and cross-platform compatibility","directories":{},"_nodeVersion":"24.11.0","_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/sqlcipher-wasm_1.0.7_1762031234438_0.4666971093315848","host":"s3://npm-registry-packages-npm-production"}},"1.0.9":{"name":"@7mind.io/sqlcipher-wasm","version":"1.0.9","keywords":["sqlcipher","sqlite","wasm","webassembly","database","sql","browser","node","isomorphic","offline","cross-platform","emscripten"],"author":{"name":"7Mind"},"license":"MIT","_id":"@7mind.io/sqlcipher-wasm@1.0.9","maintainers":[{"name":"pshirshov","email":"pshirshov@gmail.com"}],"homepage":"https://github.com/7mind/sqlcipher-wasm#readme","bugs":{"url":"https://github.com/7mind/sqlcipher-wasm/issues"},"dist":{"shasum":"c5903bc7f0d14e634704d68c169440c3562c2497","tarball":"https://registry.npmjs.org/@7mind.io/sqlcipher-wasm/-/sqlcipher-wasm-1.0.9.tgz","fileCount":9,"integrity":"sha512-Cztnpc69OxPnxTzGzKk7qW/ZSv9xNFAqCfQCRiEBvq0k74pev/TksQX6e1SCe+pJ4zT8NPvVwh3muvOEbVjy3w==","signatures":[{"sig":"MEQCIA3Jo1emIS4D3KwTV85C347XgKz/+DmPPOotftsCbSGuAiAGUDM7GdqwrGfdEk37a37txd3Aocjkl8RHwrcaiHVykg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@7mind.io%2fsqlcipher-wasm@1.0.9","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":2982835},"main":"./lib/sqlite-api.cjs","type":"module","types":"./lib/sqlite-api.d.ts","module":"./lib/sqlite-api.mjs","engines":{"node":">=16.0.0"},"exports":{".":{"import":"./lib/sqlite-api.mjs","require":"./lib/sqlite-api.cjs"},"./dist/sqlcipher.cjs":"./dist/sqlcipher.cjs","./dist/sqlcipher.mjs":"./dist/sqlcipher.mjs"},"gitHead":"de7062aa35939dcebaa42daa7bd829641cae046c","scripts":{"test":"node test/run-all-tests.cjs","bench":"node bench/benchmark.cjs","build":"./build.sh","test:watch":"nodemon --watch test --watch lib --watch dist test/run-all-tests.cjs","prepublishOnly":"npm run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:0ad2997d-1b52-4a36-b465-57e9947662e9"}},"repository":{"url":"git+https://github.com/7mind/sqlcipher-wasm.git","type":"git"},"_npmVersion":"11.6.1","description":"A production-ready WebAssembly build of SQLCipher with real OpenSSL-based encryption, a high-level isomorphic API, and comprehensive test coverage.","directories":{},"_nodeVersion":"24.11.0","_hasShrinkwrap":false,"devDependencies":{"nodemon":"^3.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sqlcipher-wasm_1.0.9_1764710863942_0.7297826113517163","host":"s3://npm-registry-packages-npm-production"}},"1.0.10":{"name":"@7mind.io/sqlcipher-wasm","version":"1.0.10","keywords":["sqlcipher","sqlite","wasm","webassembly","database","sql","browser","node","isomorphic","offline","cross-platform","emscripten"],"author":{"name":"7Mind"},"license":"MIT","_id":"@7mind.io/sqlcipher-wasm@1.0.10","maintainers":[{"name":"pshirshov","email":"pshirshov@gmail.com"}],"homepage":"https://github.com/7mind/sqlcipher-wasm#readme","bugs":{"url":"https://github.com/7mind/sqlcipher-wasm/issues"},"dist":{"shasum":"fa40c4469dad466fdb9c9080f855a8f5b3a9fa1a","tarball":"https://registry.npmjs.org/@7mind.io/sqlcipher-wasm/-/sqlcipher-wasm-1.0.10.tgz","fileCount":9,"integrity":"sha512-nDSluFcN72N5Hcirux6lm4Di2HwTJeyJoo5znehewJoubsfgGXvp+x9GL9wNKmIY4qUnqmEllvYDLoKoqtdKBA==","signatures":[{"sig":"MEQCIH+SNXWVG8O7xGKosOJtYDs7qRaN4T/JurTMHHvYigpMAiBoUjhsQO4f0is9EguvMs25cLa015NMy3hmxz1PKNnh5Q==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@7mind.io%2fsqlcipher-wasm@1.0.10","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":6708234},"main":"./lib/sqlite-api.cjs","type":"module","types":"./lib/sqlite-api.d.ts","module":"./lib/sqlite-api.mjs","engines":{"node":">=16.0.0"},"exports":{".":{"import":"./lib/sqlite-api.mjs","require":"./lib/sqlite-api.cjs"},"./dist/sqlcipher.cjs":"./dist/sqlcipher.cjs","./dist/sqlcipher.mjs":"./dist/sqlcipher.mjs"},"gitHead":"a634b549e5b7547cf54a8d81b5b5ed24d1687c4b","scripts":{"test":"node test/run-all-tests.cjs","bench":"node bench/benchmark.cjs","build":"./build.sh","test:watch":"nodemon --watch test --watch lib --watch dist test/run-all-tests.cjs","prepublishOnly":"npm run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:0ad2997d-1b52-4a36-b465-57e9947662e9"}},"repository":{"url":"git+https://github.com/7mind/sqlcipher-wasm.git","type":"git"},"_npmVersion":"11.6.1","description":"A production-ready WebAssembly build of SQLCipher with real OpenSSL-based encryption, a high-level isomorphic API, and comprehensive test coverage.","directories":{},"_nodeVersion":"24.11.0","_hasShrinkwrap":false,"devDependencies":{"nodemon":"^3.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sqlcipher-wasm_1.0.10_1764786483246_0.23566633002779924","host":"s3://npm-registry-packages-npm-production"}},"1.0.11":{"name":"@7mind.io/sqlcipher-wasm","version":"1.0.11","keywords":["sqlcipher","sqlite","wasm","webassembly","database","sql","browser","node","isomorphic","offline","cross-platform","emscripten"],"author":{"name":"7Mind"},"license":"MIT","_id":"@7mind.io/sqlcipher-wasm@1.0.11","maintainers":[{"name":"pshirshov","email":"pshirshov@gmail.com"}],"homepage":"https://github.com/7mind/sqlcipher-wasm#readme","bugs":{"url":"https://github.com/7mind/sqlcipher-wasm/issues"},"dist":{"shasum":"cbaf2d83b1255cb8e2b731de8f82f3b43ebbaba6","tarball":"https://registry.npmjs.org/@7mind.io/sqlcipher-wasm/-/sqlcipher-wasm-1.0.11.tgz","fileCount":9,"integrity":"sha512-7BR1JO2k27yNFnuyNPKMa/RLJL+gJW5ZehgZdgRvSdVOIX449IFGxsqyOF8WpnzKCtw35bLGMCh445gJbgOH3g==","signatures":[{"sig":"MEUCIE+FvIIkvEzRmvfrPlr4XT5AjJ4u446pSSUtRdXyF0gBAiEA2OPr5WtR5ay3HtoWE4AHRrvLEgsb7cZIxcprYTVGDI8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@7mind.io%2fsqlcipher-wasm@1.0.11","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":6708348},"main":"./lib/sqlite-api.cjs","type":"module","types":"./lib/sqlite-api.d.ts","module":"./lib/sqlite-api.mjs","engines":{"node":">=16.0.0"},"exports":{".":{"import":"./lib/sqlite-api.mjs","require":"./lib/sqlite-api.cjs"},"./dist/sqlcipher.cjs":"./dist/sqlcipher.cjs","./dist/sqlcipher.mjs":"./dist/sqlcipher.mjs"},"gitHead":"401d41f609d8bd257e02a6c1ef7602b3c9e3a3c2","scripts":{"test":"node test/run-all-tests.cjs","bench":"node bench/benchmark.cjs","build":"./build.sh","test:watch":"nodemon --watch test --watch lib --watch dist test/run-all-tests.cjs","prepublishOnly":"npm run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:0ad2997d-1b52-4a36-b465-57e9947662e9"}},"repository":{"url":"git+https://github.com/7mind/sqlcipher-wasm.git","type":"git"},"_npmVersion":"11.6.1","description":"A production-ready WebAssembly build of SQLCipher with real OpenSSL-based encryption, a high-level isomorphic API, and comprehensive test coverage.","directories":{},"_nodeVersion":"24.11.0","_hasShrinkwrap":false,"devDependencies":{"nodemon":"^3.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sqlcipher-wasm_1.0.11_1764795767889_0.8631301432766665","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@7mind.io/sqlcipher-wasm","version":"1.1.0","keywords":["sqlcipher","sqlite","wasm","webassembly","database","sql","browser","node","isomorphic","offline","cross-platform","emscripten"],"author":{"name":"7Mind"},"license":"MIT","_id":"@7mind.io/sqlcipher-wasm@1.1.0","maintainers":[{"name":"pshirshov","email":"pshirshov@gmail.com"}],"homepage":"https://github.com/7mind/sqlcipher-wasm#readme","bugs":{"url":"https://github.com/7mind/sqlcipher-wasm/issues"},"dist":{"shasum":"caccd06176f73d2588e1e68047028cb8d12102a3","tarball":"https://registry.npmjs.org/@7mind.io/sqlcipher-wasm/-/sqlcipher-wasm-1.1.0.tgz","fileCount":9,"integrity":"sha512-2ViKUnssfn1M+arg71Cc9j7/UGXw73vMb646VsAS+g5+LiSGxHKMp4Pz2269aagsoqspEG+C504RkX3qtGcqMA==","signatures":[{"sig":"MEQCIFaGMJo01k3eKYE5bSg7+kY1tZeNUHSAJzACt3+bbVjoAiBF9uVpVRiei4Oka91QJCz5L/sP3xZYfkuV+WBhacaFmw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@7mind.io%2fsqlcipher-wasm@1.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":7527811},"main":"./lib/sqlite-api.cjs","type":"module","types":"./lib/sqlite-api.d.ts","module":"./lib/sqlite-api.mjs","engines":{"node":">=16.0.0"},"exports":{".":{"import":"./lib/sqlite-api.mjs","require":"./lib/sqlite-api.cjs"},"./dist/sqlcipher.cjs":"./dist/sqlcipher.cjs","./dist/sqlcipher.mjs":"./dist/sqlcipher.mjs"},"gitHead":"6c3e909d241a965e5647ab80132e4034096275b0","scripts":{"test":"node test/run-all-tests.cjs","bench":"node bench/benchmark.cjs","build":"./build-wasm.sh","test:watch":"nodemon --watch test --watch lib --watch dist test/run-all-tests.cjs","prepublishOnly":"npm run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:0ad2997d-1b52-4a36-b465-57e9947662e9"}},"repository":{"url":"git+https://github.com/7mind/sqlcipher-wasm.git","type":"git"},"_npmVersion":"11.6.2","description":"A production-ready WebAssembly build of SQLCipher with real OpenSSL-based encryption, a high-level isomorphic API, and comprehensive test coverage.","directories":{},"_nodeVersion":"24.11.1","_hasShrinkwrap":false,"devDependencies":{"nodemon":"^3.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sqlcipher-wasm_1.1.0_1773223689088_0.7401724952403039","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@7mind.io/sqlcipher-wasm","version":"1.2.0","description":"A production-ready WebAssembly build of SQLCipher with real OpenSSL-based encryption, a high-level isomorphic API, and comprehensive test coverage.","type":"module","main":"./lib/sqlite-api.cjs","module":"./lib/sqlite-api.mjs","types":"./lib/sqlite-api.d.ts","exports":{".":{"import":"./lib/sqlite-api.mjs","require":"./lib/sqlite-api.cjs"},"./dist/sqlcipher.mjs":"./dist/sqlcipher.mjs","./dist/sqlcipher.cjs":"./dist/sqlcipher.cjs"},"engines":{"node":">=16.0.0"},"scripts":{"prepublishOnly":"npm run build","build":"./build-wasm.sh","test":"node test/run-all-tests.cjs","test:watch":"nodemon --watch test --watch lib --watch dist test/run-all-tests.cjs","bench":"node bench/benchmark.cjs"},"keywords":["sqlcipher","sqlite","wasm","webassembly","database","sql","browser","node","isomorphic","offline","cross-platform","emscripten"],"author":{"name":"7Mind"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/7mind/sqlcipher-wasm.git"},"bugs":{"url":"https://github.com/7mind/sqlcipher-wasm/issues"},"homepage":"https://github.com/7mind/sqlcipher-wasm#readme","devDependencies":{"nodemon":"^3.0.0"},"gitHead":"01a3bd071e5ca59b5d3f1e2979f1451d2b08ce28","_id":"@7mind.io/sqlcipher-wasm@1.2.0","_nodeVersion":"24.11.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-dmqgG7yM/JtTmcKglm6bSv6pVfJzZ0AF3lekY6hws0dhtSSnluwOHnC0JGMXF9pimIUVRpJ84QDHKKCXSDmvHw==","shasum":"52798bca2e3353e1c1cf54a490a332a98f7f1f5a","tarball":"https://registry.npmjs.org/@7mind.io/sqlcipher-wasm/-/sqlcipher-wasm-1.2.0.tgz","fileCount":9,"unpackedSize":7533254,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@7mind.io%2fsqlcipher-wasm@1.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDXMmsq7mClB6iQg58W5BKWQy9anNus7qWeoYTImrvPuwIhAMZgkzQ+GMlbFrUagezTJo3tSk2flG698ZVTBBI14e+a"}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:0ad2997d-1b52-4a36-b465-57e9947662e9"}},"directories":{},"maintainers":[{"name":"pshirshov","email":"pshirshov@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sqlcipher-wasm_1.2.0_1777279749507_0.543216670059024"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-01T18:22:38.851Z","modified":"2026-04-27T08:49:10.054Z","1.0.0":"2025-11-01T18:22:39.134Z","1.0.3":"2025-11-01T20:22:44.320Z","1.0.4":"2025-11-01T20:32:58.544Z","1.0.5":"2025-11-01T20:45:05.753Z","1.0.7":"2025-11-01T21:07:14.707Z","1.0.9":"2025-12-02T21:27:44.188Z","1.0.10":"2025-12-03T18:28:03.493Z","1.0.11":"2025-12-03T21:02:48.131Z","1.1.0":"2026-03-11T10:08:09.469Z","1.2.0":"2026-04-27T08:49:09.783Z"},"bugs":{"url":"https://github.com/7mind/sqlcipher-wasm/issues"},"author":{"name":"7Mind"},"license":"MIT","homepage":"https://github.com/7mind/sqlcipher-wasm#readme","keywords":["sqlcipher","sqlite","wasm","webassembly","database","sql","browser","node","isomorphic","offline","cross-platform","emscripten"],"repository":{"type":"git","url":"git+https://github.com/7mind/sqlcipher-wasm.git"},"description":"A production-ready WebAssembly build of SQLCipher with real OpenSSL-based encryption, a high-level isomorphic API, and comprehensive test coverage.","maintainers":[{"name":"pshirshov","email":"pshirshov@gmail.com"}],"readme":"# SQLCipher WebAssembly\n\n[![npm version](https://badge.fury.io/js/%407mind.io%2Fsqlcipher-wasm.svg)](https://www.npmjs.com/package/@7mind.io/sqlcipher-wasm)\n[![CI/CD](https://github.com/7mind/sqlcipher-wasm/workflows/CI%2FCD/badge.svg)](https://github.com/7mind/sqlcipher-wasm/actions)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nA production-ready WebAssembly build of [SQLCipher](https://www.zetetic.net/sqlcipher/) with **real OpenSSL-based encryption**, high-level JavaScript API, and comprehensive test coverage.\n\n## Features\n\n- **Real Encryption**: Full SQLCipher encryption using OpenSSL 3.3.2 compiled to WebAssembly\n- **High-Level API**: Easy-to-use JavaScript wrapper with automatic memory management\n- **Cross-Platform**: Works in Node.js and browsers, compatible with native SQLCipher databases\n- **Comprehensive Tests**: 5 test suites covering all functionality including cross-platform compatibility\n- **Nix Flake Environment**: Reproducible development environment\n- **Type Definitions**: TypeScript definitions included\n- **Benchmarked**: Performance benchmarks for critical operations\n\n## Security\n\nThis build uses **real cryptographic primitives** from OpenSSL 3.3.2, providing:\n\n- **AES-256-CBC** encryption\n- **PBKDF2-HMAC-SHA1** key derivation (64,000 iterations by default)\n- **HMAC-SHA1** for authentication\n- **Cryptographically secure** random number generation\n\nDatabases created with this library are **fully compatible** with native SQLCipher (C++ version).\n\n## Prerequisites\n\n- [Nix](https://nixos.org/download.html) with flakes enabled\n- [direnv](https://direnv.net/) (optional but recommended)\n\n### Enable Nix Flakes\n\nAdd to your `~/.config/nix/nix.conf` (or `/etc/nix/nix.conf`):\n\n```\nexperimental-features = nix-command flakes\n```\n\n## Build Variants\n\nThree build targets are available, all using SQLCipher v4.9.0:\n\n| Target | Script(s) | Shell | Emscripten | Crypto | Output |\n|--------|-----------|-------|------------|--------|--------|\n| **WASM** (Node.js/Browser) | `build-wasm.sh` | `nix develop` | Latest (in-tree) | OpenSSL 3.3.2 | `dist/` + `target/results/sqlcipher-wasm.zip` |\n| **WebGL** (Unity 2022.3.22f) | `build-webgl.sh` | `nix develop .#webgl` | 3.1.10 (pinned) | OpenSSL 3.3.2 | `target/results/sqlcipher-webgl.zip` |\n| **Amalgamation** (Unity, any emcc) | `build-libtomcrypt.sh` → `build-amalgamation.sh` | `nix develop` | n/a (source bundle) | libtomcrypt 1.18.2 | `target/results/sqlcipher-amalgamation.zip` |\n\nThe WebGL build additionally enables `SQLITE_ENABLE_SNAPSHOT` and `SQLITE_ENABLE_COLUMN_METADATA`.\n\n### When to use the Amalgamation bundle\n\nThe **WebGL** target above emits a prebuilt `libsqlcipher.a` that must ABI-match the emcc Unity ships with. That's fine for a single pinned Unity version but breaks across upgrades: a `.a` built with emcc 3.1.10 (Unity 2022.3.22f) linked into Unity 6000.4 (emcc 3.1.38) traps at runtime with `signature_mismatch:time` — libc signatures like `time_t` drifted between emcc versions.\n\nThe **Amalgamation** target sidesteps this entirely: it ships portable C source (one `sqlite3.c`, one `libtomcrypt.c`, and a small set of headers) that Unity's own bundled emcc compiles in-tree, so the same bundle works across 2022.3, 6000.x, and future Unity versions with no toolchain pin.\n\nCrypto is libtomcrypt instead of OpenSSL because OpenSSL has no usable source-drop path (Perl-driven Configure, generated `opensslconf.h`, hundreds of per-file `-D` flags). libtomcrypt amalgamates cleanly into a single `.c` once curated to the subset SQLCipher actually calls (AES, SHA1/2, HMAC, CBC/ECB, PBKDF2, PRNG, registration helpers).\n\n## Quick Start\n\n### WASM (Node.js / Browser)\n\nInteractive:\n\n```bash\nnix develop\n./build-openssl.sh\n./build-wasm.sh\nnpm test\n```\n\nOne-liner:\n\n```bash\nnix develop --command bash -c './build-openssl.sh && ./build-wasm.sh'\n```\n\n### WebGL (Unity 2022.3.22f, prebuilt .a)\n\nInteractive:\n\n```bash\nnix develop .#webgl\n./build-openssl.sh\n./build-webgl.sh\n```\n\nOne-liner:\n\n```bash\nnix develop .#webgl --command bash -c './build-openssl.sh && ./build-webgl.sh'\n```\n\n### Amalgamation (Unity, any emcc — source bundle)\n\nInteractive:\n\n```bash\nnix develop\n./build-libtomcrypt.sh\n./build-amalgamation.sh\n```\n\nOne-liner:\n\n```bash\nnix develop --command bash -c './build-libtomcrypt.sh && ./build-amalgamation.sh'\n```\n\nThe output `target/results/sqlcipher-amalgamation/` is a flat drop-in directory:\n\n```\nsqlite3.c              SQLCipher amalgamation (compile flags baked in at top)\nsqlite3.h              SQLCipher public header\nlibtomcrypt.c          curated libtomcrypt amalgamation\ntomcrypt*.h            13 libtomcrypt headers (angled includes rewritten to quoted)\nLICENSE_libtomcrypt    libtomcrypt license\nREADME.txt             Unity integration notes\n```\n\nCopy the directory into `Assets/Plugins/WebGL/sqlcipher/` — that's it. No plugin importer compile flags, no include paths, no force-includes. Every `-D` and `-I` that would normally be needed is either prepended into `sqlite3.c` itself or obviated by the flat layout (quoted sibling includes resolve via clang's current-file-directory search). The same bundle compiles unchanged on Unity 2022.3 (emcc 3.1.10), Unity 6000.4 (emcc 3.1.38), and whatever emcc the next Unity ships.\n\n## Project Structure\n\n```\n.\n├── flake.nix                       # Nix flake (default + webgl shells)\n├── .envrc                          # direnv configuration\n├── lib.sh                          # Shared build utilities (includes patch_amalgamation)\n├── build-openssl.sh                # OpenSSL WASM build script\n├── build-wasm.sh                   # SQLCipher WASM build (CJS/ESM)\n├── build-webgl.sh                  # SQLCipher static lib build (Unity WebGL, emcc-pinned)\n├── build-libtomcrypt.sh            # libtomcrypt curated-amalgamation stage (no emcc)\n├── build-amalgamation.sh           # SQLCipher + libtomcrypt source bundle (Unity, any emcc)\n├── package.json                    # NPM package configuration\n├── target/\n│   ├── build/                      # Intermediate build artifacts\n│   │   ├── openssl-3.3.2/          # OpenSSL source (shared)\n│   │   ├── libtomcrypt-1.18.2/     # libtomcrypt source (shared)\n│   │   ├── libtomcrypt-amalg/      # Curated libtomcrypt amalgamation output\n│   │   ├── amalgamation/           # SQLCipher amalgamation working dir\n│   │   └── emcc-<version>/         # Per-emscripten-version builds\n│   │       ├── openssl-wasm/       # Compiled OpenSSL\n│   │       ├── sqlcipher-wasm/     # WASM build working dir\n│   │       └── sqlcipher-webgl/    # WebGL build working dir\n│   └── results/                    # Final build outputs\n│       ├── sqlcipher-wasm/         # WASM artifacts (unpacked)\n│       ├── sqlcipher-wasm.zip      # WASM archive\n│       ├── sqlcipher-webgl/        # WebGL artifacts (unpacked)\n│       │   ├── libsqlcipher.a\n│       │   └── openssl/\n│       │       ├── libcrypto.a\n│       │       └── libssl.a\n│       ├── sqlcipher-webgl.zip     # WebGL archive\n│       ├── sqlcipher-amalgamation/ # Source bundle (unpacked)\n│       └── sqlcipher-amalgamation.zip # Source bundle archive\n├── dist/                           # NPM package output\n│   ├── sqlcipher.cjs               # CommonJS module (Node.js)\n│   ├── sqlcipher.mjs               # ES module (browser)\n│   └── sqlcipher.wasm              # WebAssembly binary\n├── lib/\n│   └── sqlite-api.cjs              # High-level JavaScript API\n├── test/\n│   ├── run-all-tests.cjs           # Test suite runner\n│   ├── test.cjs                    # Core functionality tests\n│   ├── e2e-test.cjs                # End-to-end tests\n│   ├── file-db-test.cjs            # File persistence tests\n│   ├── encryption-test.cjs         # Encryption tests\n│   └── cross-platform-db-test.cjs  # C++ <-> WASM compatibility (generated)\n├── bench/\n│   └── benchmark.cjs               # Performance benchmarks\n├── examples/\n│   └── example.cjs                 # Usage examples\n├── tools/\n│   └── prepare-cross-platform-test.sh\n└── docs/\n    └── archive/\n```\n\n## Build Process\n\nAll build scripts source `lib.sh` which auto-detects the emscripten version and sets up versioned build/cache directories. This allows the default and webgl shells to coexist without conflicts.\n\n### 1. OpenSSL Build (`build-openssl.sh`)\n\nDownloads and compiles OpenSSL 3.3.2 to WebAssembly:\n\n- Configured for WASM target (`linux-generic32`)\n- Optimized build (`-O3 -flto`)\n- Disabled features: ASM, threads, engines, hardware acceleration\n- Static library output to `target/build/emcc-<version>/openssl-wasm/`\n- OpenSSL source tarball is shared across emscripten versions\n\n### 2. SQLCipher WASM Build (`build-wasm.sh`)\n\nCompiles SQLCipher with OpenSSL into CJS/ESM modules:\n\n1. Copies SQLCipher v4.9.0 source from Nix store\n2. Configures and creates amalgamation (`sqlite3.c`)\n3. Patches amalgamation to use OpenSSL crypto provider\n4. Compiles and links with OpenSSL static libraries\n5. Outputs to `dist/` (for npm) and `target/results/sqlcipher-wasm/`\n6. Creates `target/results/sqlcipher-wasm.zip`\n\n### 3. SQLCipher WebGL Build (`build-webgl.sh`)\n\nCompiles SQLCipher into a static library for Unity 2022.3.22f WebGL:\n\n1. Same amalgamation process as WASM build\n2. Compiles with emscripten 3.1.10 (ABI-compatible with Unity's bundled emscripten)\n3. Outputs `libsqlcipher.a` + OpenSSL libs to `target/results/sqlcipher-webgl/`\n4. Creates `target/results/sqlcipher-webgl.zip`\n\n### 4. libtomcrypt Amalgamation Stage (`build-libtomcrypt.sh`)\n\nPrepares a curated libtomcrypt amalgamation consumed by `build-amalgamation.sh`. This is a source-transform stage — no emcc is invoked.\n\n1. Downloads libtomcrypt 1.18.2 tarball (shared across runs)\n2. Enumerates the subset SQLCipher calls: AES, SHA1/2 family, HMAC, CBC/ECB modes, PBKDF2 (PKCS#5 alg2), PRNGs, registration/argchk helpers\n3. Inlines `aes_tab.c` into `aes.c` so the amalgamation has no side-file dependency\n4. Concatenates the subset into `target/build/libtomcrypt-amalg/libtomcrypt.c`\n5. Copies the 13 upstream headers to `target/build/libtomcrypt-amalg/headers/`\n6. Smoke-tests the result compiles cleanly with host `cc`\n\nUnrelated algorithms (Blowfish, Camellia, Khazad, MDx, RIPEMD, etc.) are intentionally omitted — they collide on static symbols (T-tables, per-algo `F`/`G` macros) when amalgamated, and SQLCipher never touches them.\n\n### 5. Unity Source Bundle (`build-amalgamation.sh`)\n\nAssembles the SQLCipher + libtomcrypt **source** bundle consumable by Unity's own emcc, so the same output works across Unity versions without ABI pinning.\n\n1. Asserts `build-libtomcrypt.sh` has been run (its output is in `target/build/libtomcrypt-amalg/`)\n2. Builds the SQLCipher amalgamation (`sqlite3.c` + `sqlite3.h`) via the standard `./configure && make sqlite3.c` flow — still no emcc\n3. Patches `sqlite3.c` to activate the libtomcrypt provider and disable OpenSSL/NSS/CC\n4. Copies the prebuilt `libtomcrypt.c` and headers alongside\n5. Prepends the SQLCipher/SQLite `#define` block directly to the top of the bundled `sqlite3.c` so no `-D` flags are ever needed at compile time\n6. Rewrites `#include <tomcrypt.h>` (in sqlite3.c's crypto_libtomcrypt section) to `\"tomcrypt.h\"` so it resolves from the plugin's own directory without an `-I` path\n7. Flattens all libtomcrypt headers alongside `libtomcrypt.c` in the bundle root so quote-include lookups succeed out of the box\n8. Creates `target/results/sqlcipher-amalgamation.zip`\n\n**Compilation Flags** (shared by WASM and WebGL builds):\n\n- `SQLITE_HAS_CODEC` - Enable encryption\n- `SQLCIPHER_CRYPTO_OPENSSL` - Use OpenSSL crypto provider\n- `SQLITE_TEMP_STORE=2` - Use memory for temporary storage\n- `SQLITE_THREADSAFE=1` - Thread-safe (required by SQLCipher v4.9.0)\n- `SQLITE_ENABLE_FTS5` - Full-text search\n- `SQLITE_ENABLE_RTREE` - Spatial indexing\n- `SQLITE_ENABLE_JSON1` - JSON support\n\nWebGL build adds:\n- `SQLITE_ENABLE_SNAPSHOT` - Database snapshot support\n- `SQLITE_ENABLE_COLUMN_METADATA` - Column metadata API\n\nAmalgamation bundle substitutes the OpenSSL provider with libtomcrypt:\n- `SQLCIPHER_CRYPTO_LIBTOMCRYPT` replaces `SQLCIPHER_CRYPTO_OPENSSL`\n- `LTC_SOURCE` enables libtomcrypt internal symbols\n- every flag is prepended directly into `sqlite3.c` / `libtomcrypt.c` at bundle assembly time — no external `-D` or force-include header needed\n\n## Usage\n\n### Basic Example\n\n```javascript\nconst { SQLiteAPI } = require('./lib/sqlite-api.cjs');\nconst initSqlcipher = require('./dist/sqlcipher.js');\n\nasync function main() {\n    // Initialize the WASM module\n    const Module = await initSqlcipher();\n    const sqlite = new SQLiteAPI(Module);\n\n    // Create an encrypted database\n    const db = sqlite.open('/mydb.db', 'my-secret-password');\n\n    // Create a table\n    db.exec('CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT, email TEXT)');\n\n    // Insert data\n    db.exec(\n        'INSERT INTO users (name, email) VALUES (?, ?)',\n        ['Alice', 'alice@example.com']\n    );\n\n    // Query data\n    const users = db.query('SELECT * FROM users WHERE name = ?', ['Alice']);\n    console.log(users);\n    // => [{ id: 1, name: 'Alice', email: 'alice@example.com' }]\n\n    // Close database\n    db.close();\n}\n\nmain();\n```\n\n### Encryption Examples\n\n```javascript\n// Open with password\nconst db = sqlite.open('/encrypted.db', 'password123');\n\n// Change password (re-key)\ndb.exec(\"PRAGMA rekey = 'new-password'\");\n\n// Multiple databases with different passwords\nconst db1 = sqlite.open('/db1.db', 'password1');\nconst db2 = sqlite.open('/db2.db', 'password2');\n\n// Check encryption worked\ndb1.exec('SELECT count(*) FROM sqlite_master'); // OK\ndb2.exec('SELECT count(*) FROM sqlite_master'); // OK\n```\n\n### Browser Usage\n\n```html\n<script type=\"module\">\n  import initSqlcipher from './dist/sqlcipher.js';\n  import { SQLiteAPI } from './lib/sqlite-api.js';\n\n  const Module = await initSqlcipher();\n  const sqlite = new SQLiteAPI(Module);\n\n  const db = sqlite.open('/mydb.db', 'secret');\n  console.log('SQLCipher ready!');\n</script>\n```\n\n## API Reference\n\n### `SQLiteAPI`\n\nHigh-level JavaScript API for SQLCipher.\n\n#### `open(path, password?)`\n\nOpen or create a database.\n\n- `path` - Database file path (e.g., `/mydb.db`)\n- `password` - Encryption password (optional for unencrypted databases)\n- Returns: `Database` instance\n\n#### `Database` Methods\n\n##### `exec(sql, params?)`\n\nExecute SQL statement.\n\n- `sql` - SQL statement\n- `params` - Optional array of parameters for `?` placeholders\n- Returns: `void`\n\n##### `query(sql, params?)`\n\nExecute query and return results.\n\n- `sql` - SQL query\n- `params` - Optional array of parameters\n- Returns: Array of result objects\n\n##### `close()`\n\nClose the database connection.\n\n##### `getChanges()`\n\nGet number of rows changed by last statement.\n\n- Returns: `number`\n\n## Test Suite\n\nThe test suite includes 5 comprehensive test suites:\n\n### 1. Unit Tests (`test/test.cjs`)\n- Module loading and initialization\n- Basic SQL operations\n- Memory management\n- API correctness\n\n### 2. End-to-End Tests (`test/e2e-test.cjs`)\n- Complete workflows\n- Multi-step operations\n- Error handling\n- Edge cases\n\n### 3. File Database Tests (`test/file-db-test.cjs`)\n- File persistence\n- VFS (Virtual File System)\n- Database reopening\n- File operations\n\n### 4. Encryption Tests (`test/encryption-test.cjs`)\n- PRAGMA key interface\n- Password verification\n- Multiple databases with different passwords\n- Database re-keying\n- Wrong password handling\n- API key vs PRAGMA key equivalence\n\n### 5. Cross-Platform Tests (`test/cross-platform-db-test.cjs`)\n- C++ (native SQLCipher) -> WASM compatibility\n- Database created with native SQLCipher, read by WASM\n- Binary compatibility verification\n- Real-world migration scenarios\n\nRun all tests:\n```bash\nnpm test\n```\n\nRun tests in watch mode:\n```bash\nnpm run test:watch\n```\n\n## Benchmarks\n\nRun performance benchmarks:\n\n```bash\nnpm run bench\n```\n\nBenchmarks measure:\n- Module initialization time\n- Memory allocation performance\n- Database operations (INSERT, SELECT, UPDATE, DELETE)\n- Query performance\n- Encryption overhead\n- Memory usage patterns\n\n## Cross-Platform Compatibility\n\nDatabases created with this WASM build are **100% compatible** with native SQLCipher.\n\n### Testing Cross-Platform Compatibility\n\nGenerate and run the cross-platform test:\n\n```bash\n./tools/prepare-cross-platform-test.sh\nnode test/cross-platform-db-test.cjs\n```\n\nThis creates a database with native SQLCipher (C++), encodes it, and verifies WASM can read it.\n\n### Migrating from Native SQLCipher\n\nJust copy your `.db` file and open it with the same password:\n\n```javascript\nconst db = sqlite.open('/path/to/existing.db', 'same-password');\nconst data = db.query('SELECT * FROM your_table');\n```\n\n### Using WASM Databases in Native Apps\n\nThe reverse also works - databases created in WASM can be used in native applications.\n\n## Development\n\n### Rebuilding\n\nClean rebuild (WASM):\n\n```bash\nrm -rf target/ dist/\n./build-openssl.sh && ./build-wasm.sh\n```\n\nClean rebuild (WebGL):\n\n```bash\nrm -rf target/\n./build-openssl.sh && ./build-webgl.sh\n```\n\nFull clean:\n\n```bash\nrm -rf target/ dist/\n```\n\n### Adding Tests\n\nAdd to appropriate test file in `test/`:\n\n```javascript\ntest('Your test name', () => {\n    const db = sqlite.open('/test.db', 'password');\n    db.exec('CREATE TABLE test (id INTEGER)');\n    const result = db.query('SELECT * FROM test');\n    assert.strictEqual(result.length, 0);\n    db.close();\n});\n```\n\nTests are automatically picked up by `npm test`.\n\n## CI/CD\n\nGitHub Actions workflows:\n\n- **CI/CD** (`.github/workflows/ci.yml`) - Build, test, and publish on releases\n- **PR Checks** (`.github/workflows/pr-check.yml`) - Quick validation on pull requests\n\nCI pipeline:\n1. Build OpenSSL + SQLCipher WASM (`nix develop`)\n2. Build OpenSSL + SQLCipher WebGL (`nix develop .#webgl`)\n3. Run tests and benchmarks\n4. Upload `sqlcipher-wasm.zip` and `sqlcipher-webgl.zip` as artifacts\n5. Publish to NPM and create GitHub Release on tags\n\n## Troubleshooting\n\n### Build fails with \"SQLCIPHER_SRC not set\"\n\nEnter the Nix environment:\n```bash\nnix develop\n```\n\n### Build fails with OpenSSL errors\n\nRebuild OpenSSL:\n```bash\nrm -rf target/build/\n./build-openssl.sh\n```\n\n### Tests fail with \"Cannot find module\"\n\nBuild first:\n```bash\n./build-openssl.sh && ./build-wasm.sh\n```\n\n### \"file is encrypted or is not a database\"\n\nWrong password or corrupted database. Verify password:\n```javascript\ntry {\n    const db = sqlite.open('/test.db', 'password');\n    db.query('SELECT * FROM sqlite_master'); // Will fail if wrong password\n} catch (err) {\n    console.log('Wrong password or corrupted database');\n}\n```\n\n### Out of memory during build\n\nIncrease Node.js memory:\n```bash\nexport NODE_OPTIONS=\"--max-old-space-size=4096\"\n./build-wasm.sh\n```\n\n### Cross-platform test fails\n\nMake sure native SQLCipher is available (provided by Nix environment):\n```bash\nnix develop --command bash -c \"which sqlcipher\"\n```\n\n## Performance Tips\n\n1. **Batch operations** - Use transactions for multiple inserts\n2. **Prepare statements** - Reuse prepared statements for repeated queries\n3. **Appropriate memory settings** - Adjust `PRAGMA cache_size`\n4. **Index wisely** - Create indexes for frequently queried columns\n5. **Use the benchmarks** - Profile before optimizing\n\nExample batch insert:\n\n```javascript\ndb.exec('BEGIN TRANSACTION');\nfor (let i = 0; i < 1000; i++) {\n    db.exec('INSERT INTO users (name) VALUES (?)', [`User ${i}`]);\n}\ndb.exec('COMMIT');\n```\n\n## Contributing\n\nContributions welcome! Areas for improvement:\n\n- [ ] Browser-based test runner\n- [ ] More comprehensive benchmarks\n- [ ] IndexedDB persistence examples\n- [ ] Worker thread examples\n- [ ] React/Vue/Svelte integration examples\n- [ ] Performance optimization guides\n\n## Publishing\n\nThe package is configured for NPM publishing:\n\n```bash\nnpm version patch  # or minor, major\ngit push --tags\n```\n\nCreate a GitHub release to trigger automatic publishing to:\n- NPM registry\n- GitHub Packages\n\n## Environment Variables\n\nIn the Nix environment:\n\n- `SQLCIPHER_SRC` - Path to SQLCipher source (set by flake.nix)\n- `EM_CACHE` - Emscripten cache directory (set by lib.sh per emcc version)\n- `NODE_PATH` - Node.js module search path\n\n## Resources\n\n- [SQLCipher Documentation](https://www.zetetic.net/sqlcipher/documentation/)\n- [OpenSSL Documentation](https://www.openssl.org/docs/)\n- [Emscripten Documentation](https://emscripten.org/docs/)\n- [SQLite Documentation](https://www.sqlite.org/docs.html)\n- [WebAssembly MDN](https://developer.mozilla.org/en-US/docs/WebAssembly)\n\n## License\n\nMIT License - See LICENSE file for details\n\nDependencies:\n- SQLCipher - BSD-style license\n- SQLite - Public domain\n- OpenSSL - Apache License 2.0\n- Emscripten - MIT/NCSA License\n\n## Acknowledgments\n\n- [SQLCipher team](https://www.zetetic.net/) for the encrypted SQLite fork\n- [OpenSSL team](https://www.openssl.org/) for the cryptographic library\n- [Emscripten team](https://emscripten.org/) for the WASM toolchain\n- [SQLite team](https://www.sqlite.org/) for the amazing database engine\n- [Nix community](https://nixos.org/) for reproducible builds\n","readmeFilename":"README.md"}