{"id":18204451,"url":"https://github.com/3p3r/wasabio","last_synced_at":"2026-05-01T12:32:53.235Z","repository":{"id":229486488,"uuid":"776853620","full_name":"3p3r/wasabio","owner":"3p3r","description":"WebAssembly and SharedArrayBuffer IO","archived":false,"fork":false,"pushed_at":"2026-01-23T19:38:24.000Z","size":136,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-24T09:18:51.368Z","etag":null,"topics":["browserify","eventemitter","filesystem","localstorage","nodejs","sharedarraybuffer","shim","webassembly","webpack"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/3p3r.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-24T16:21:30.000Z","updated_at":"2026-01-23T19:38:28.000Z","dependencies_parsed_at":"2024-04-24T04:30:16.558Z","dependency_job_id":"3c010bdf-a93c-46cc-8c5c-2e19e4b2a489","html_url":"https://github.com/3p3r/wasabio","commit_stats":null,"previous_names":["3p3r/wasabio"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/3p3r/wasabio","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3p3r%2Fwasabio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3p3r%2Fwasabio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3p3r%2Fwasabio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3p3r%2Fwasabio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/3p3r","download_url":"https://codeload.github.com/3p3r/wasabio/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3p3r%2Fwasabio/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32497812,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["browserify","eventemitter","filesystem","localstorage","nodejs","sharedarraybuffer","shim","webassembly","webpack"],"created_at":"2024-11-03T11:04:21.818Z","updated_at":"2026-05-01T12:32:53.216Z","avatar_url":"https://github.com/3p3r.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ![wasabio](wasabio.png)\n\nWebAssembly and SharedArrayBuffer IO. Pronounced \"wassabee-yo\".\n\n- [Purpose](#purpose)\n- [Usage](#usage)\n  - [API](#api)\n  - [Initialization](#initialization)\n    - [From New Memory](#from-new-memory)\n    - [From Existing Memory](#from-existing-memory)\n\n## Purpose\n\n`wasabio` offers several utility APIs with familiar interfaces, and implemented\nto work over a single SharedArrayBuffer and inside a TS-wrapped WASM module.\n\n`wasabio` provides infrastructure for multi threaded applications running in web\nbrowsers, enabling safe cross-worker communication and shared state.\n\n`wasabio` can be used in bundlers like Webpack to allow for an exchange between\nnode core modules and its own implementations to seamlessly run in the browser.\n\nCurrently `wasabio` provides:\n\n- Node's FileSystem API (implemented on top of an in-memory POSIX filesystem)\n- LocalStorage API (implemented on top of an in-memory key-value store)\n- Node's EventEmitter API (implemented on top of a SharedArrayBuffer)\n- Low level Locks, Buses, Channels, and various other utilities\n\n## Usage\n\n### API\n\nAll APIs are spec-compatible with their original counterparts.\n\n\u003e **note:** library needs to be initialized before use, see below.\n\n```typescript\nimport {\n\tlocalStorage, // in-memory key-value store for cross worker state storage\n\tEventEmitter, // lets you make named emitter for cross worker communication\n\treadFile,\n\twriteFile,\n\tappendFile,\n\treadFileSync,\n\twriteFileSync,\n\tappendFileSync,\n\t// ... Node FS api\n} from \"wasabio\";\n```\n\nSome utility functions are also provided:\n\n```typescript\n// return true if library is initialized\navailable(): boolean;\n// serializes memory to a buffer, sets the thread counter to 0\nserialize(memory: WebAssembly.Memory): Uint8Array;\n// deserializes buffer to memory, sets the correct buffer size\ndeserialize(buffer: Uint8Array): WebAssembly.Memory;\n// compresses serialized wasabio memory buffer into a zip buffer\ncompress(buffer: Uint8Array): Promise\u003cUint8Array\u003e\n// decompresses zip buffer into serialized wasabio memory buffer\ndecompress(buffer: Uint8Array): Promise\u003cUint8Array\u003e\n```\n\n### Initialization\n\n#### From New Memory\n\nInitialize `wasabio` on the first thread (usually the main thread) like so:\n\n```typescript\n// main.ts\nimport { initialize } from \"wasabio\";\nconst mem = await initialize();\n// some time later\nworker.postMessage(mem);\n```\n\nOn other threads (workers, frames, etc.) initialize `wasabio` like so:\n\n```typescript\n// worker.ts\nimport { initialize } from \"wasabio\";\naddEventListener(\"message\", async ({ data }) =\u003e {\n\tinitialize(data, { sync: true }); // sync as an option\n});\n```\n\n#### From Existing Memory\n\nInitialize `wasabio` on the first thread (usually the main thread) like so:\n\n```typescript\n// main.ts\nimport { initialize } from \"wasabio\";\nconst cold = getSharedArrayBufferFromSomewhere();\nconst hot = await initialize(cold, { reboot: true });\n// some time later\nworker.postMessage(hot);\n```\n\nOn other threads (workers, frames, etc.) initialize `wasabio` like so:\n\n```typescript\n// worker.ts\nimport { initialize } from \"wasabio\";\naddEventListener(\"message\", async ({ data }) =\u003e {\n\tinitialize(data, { reboot: false });\n});\n```\n\nIn this case, `reboot` signifies that the library is being initialized from cold\nstorage and thread-local state should be reset.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3p3r%2Fwasabio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F3p3r%2Fwasabio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3p3r%2Fwasabio/lists"}