WebSocket bindings for AssemblyScript, enabling real-time communication in WebAssembly modules. Current stable version 1.1.2 provides a simple API to create WebSocket servers and clients directly in AssemblyScript, with automatic integration via wasmImports and wasmExports. Released under MIT, it supports both Node.js and browser environments through a UMD bundle. Key differentiator: native WebSocket support in AssemblyScript without JavaScript glue code, leveraging the official ws package on Node. Development appears slow with few updates.
npm install as-websocketNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to create a WebSocket bridge in Node.js using as-websocket and load an AssemblyScript module that uses the WebSocket class.
Use 'import { WebSocket } from "as-ws"' in AssemblyScript source.Add these flags to your asc command line: 'asc file.ts --exportTable --exportRuntime'
Use the script tag from unpkg and access the global asWebSocket constructor.
Understand that asWebSocket is a bridge factory; actual WebSocket usage occurs inside AssemblyScript code.
Change import statement to 'from "as-ws"'
Use 'const asWebSocket = require("as-websocket")'Use the UMD script tag and access the global 'asWebSocket' variable