{"_id":"@cuckoox/surrealdb-wasm","name":"@cuckoox/surrealdb-wasm","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@cuckoox/surrealdb-wasm","type":"module","collaborators":["Tobie Morgan Hitchcock <tobie@surrealdb.com>"],"description":"WebAssembly driver for SurrealDB","version":"1.0.0","license":"Apache License 2.0","repository":{"type":"git","url":"git+https://github.com/surrealdb/surrealdb.wasm.git"},"main":"index.js","types":"index.d.ts","sideEffects":["./snippets/*"],"_id":"@cuckoox/surrealdb-wasm@1.0.0","gitHead":"ec5207a9d30ee7b995a2bf1c852778eba661cc3f","bugs":{"url":"https://github.com/surrealdb/surrealdb.wasm/issues"},"homepage":"https://github.com/surrealdb/surrealdb.wasm#readme","_nodeVersion":"20.18.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-mKmAjviCQksG+1Cmw23/hzRvVpOcdsbpsqixGyTcI2m61hPfqn2VBlxZIkyTtUqoK4dAcRiJsK8KjMibgci6mA==","shasum":"ca2743b302e1a7e0f37792708aef588fbb015acc","tarball":"https://registry.npmjs.org/@cuckoox/surrealdb-wasm/-/surrealdb-wasm-1.0.0.tgz","fileCount":6,"unpackedSize":12779116,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIH/HGJOvRP8UvbJ4mvbPfmfhc02BGPo5MA3T1uYWVBSCAiEA+dUsGUAay39Dkj60UEyq6fTaZpXGOfj6hgeJdBJnCrs="}]},"_npmUser":{"name":"yangyuanxin","email":"yyx1025988443@outlook.com"},"directories":{},"maintainers":[{"name":"yangyuanxin","email":"yyx1025988443@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/surrealdb-wasm_1.0.0_1755179522764_0.9124139595588336"},"_hasShrinkwrap":false}},"time":{"created":"2025-08-14T13:52:02.677Z","1.0.0":"2025-08-14T13:52:03.077Z","modified":"2025-08-14T13:52:03.356Z"},"maintainers":[{"name":"yangyuanxin","email":"yyx1025988443@outlook.com"}],"description":"WebAssembly driver for SurrealDB","homepage":"https://github.com/surrealdb/surrealdb.wasm#readme","repository":{"type":"git","url":"git+https://github.com/surrealdb/surrealdb.wasm.git"},"bugs":{"url":"https://github.com/surrealdb/surrealdb.wasm/issues"},"license":"Apache License 2.0","readme":"<br>\n\n<p align=\"center\">\n    <img width=120 src=\"https://raw.githubusercontent.com/surrealdb/icons/main/surreal.svg\" />\n    &nbsp;\n    <img width=120 src=\"https://raw.githubusercontent.com/surrealdb/icons/main/webassembly.svg\" />\n</p>\n\n<h3 align=\"center\">A WebAssembly engine for the SurrealDB JavaScript SDK.</h3>\n\n<br>\n\n<p align=\"center\">\n    <a href=\"https://github.com/surrealdb/surrealdb.wasm\"><img src=\"https://img.shields.io/badge/status-stable-ff00bb.svg?style=flat-square\"></a>\n    &nbsp;\n    <a href=\"https://surrealdb.com/docs/sdk/javascript/engines/wasm\"><img src=\"https://img.shields.io/badge/docs-view-44cc11.svg?style=flat-square\"></a>\n    &nbsp;\n    <a href=\"https://www.npmjs.com/package/@surrealdb/wasm\"><img src=\"https://img.shields.io/npm/v/@surrealdb/wasm?style=flat-square\"></a>\n    &nbsp;\n    <a href=\"https://www.npmjs.com/package/@surrealdb/wasm\"><img src=\"https://img.shields.io/npm/dm/@surrealdb/wasm?style=flat-square\"></a>\n</p>\n\n<p align=\"center\">\n    <a href=\"https://surrealdb.com/discord\"><img src=\"https://img.shields.io/discord/902568124350599239?label=discord&style=flat-square&color=5a66f6\"></a>\n    &nbsp;\n    <a href=\"https://twitter.com/surrealdb\"><img src=\"https://img.shields.io/badge/twitter-follow_us-1d9bf0.svg?style=flat-square\"></a>\n    &nbsp;\n    <a href=\"https://www.linkedin.com/company/surrealdb/\"><img src=\"https://img.shields.io/badge/linkedin-connect_with_us-0a66c2.svg?style=flat-square\"></a>\n    &nbsp;\n    <a href=\"https://www.youtube.com/@SurrealDB\"><img src=\"https://img.shields.io/badge/youtube-subscribe-fc1c1c.svg?style=flat-square\"></a>\n</p>\n\n# @surrealdb/wasm\n\nA WebAssembly engine for the SurrealDB [JavaScript SDK](https://github.com/surrealdb/surrealdb.js).\n\nThis library is a plugin for the SurrealDB JavaScript SDK, which can be used to run SurrealDB as an embedded database within a browser environment, not server side environments.\n\nIt enables SurrealDB to be run in-memory, or to persist data by running on top of IndexedDB. It allows for a consistent JavaScript and TypeScript API when using the `surrealdb.js` library by adding support for embedded storage engines (`memory`, `indxdb`) alongside the remote connection protocols (`http`, `https`, `ws`, `wss`).\n\nThis library works with ES modules (`import`), not CommonJS (`require`).\n\n## Example usage\n\n```js\nimport { Surreal } from \"surrealdb\";\nimport { surrealdbWasmEngines } from \"@surrealdb/wasm\";\n\n// Enable the WebAssembly engines\nconst db = new Surreal({\n    engines: surrealdbWasmEngines(),\n});\n\n// Now we can start SurrealDB as an in-memory database\nawait db.connect(\"mem://\");\n// Or we can start a persisted IndexedDB database\nawait db.connect(\"indxdb://demo\");\n\n// Now use the JavaScript SDK as normal.\n```\n\n## Usage with Vite\n\nWhen using [Vite](https://vitejs.dev/) the following configuration is recommended to be placed in your `vite.config.ts`\n\n```js\noptimizeDeps: {\n    exclude: [\"@surrealdb/wasm\"],\n    esbuildOptions: {\n        target: \"esnext\",\n    },\n},\nesbuild: {\n    supported: {\n        \"top-level-await\": true\n    },\n}\n```\n","readmeFilename":"README.md","_rev":"1-a26dfe6f0023333cac47d9e3205d5ae1"}