Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/websocket_broadcastchannel/mod.ts

Host-wide BroadcastChannel for Deno CLI, backed by WebSockets.
Latest
import * as websocketBroadcastchannel from "https://deno.land/x/websocket_broadcastchannel@0.8.0/mod.ts";

Classes

Use this the same way you would use BroadcastChannel on Deno Deploy, it has the same API, but on a host that is not Deno Deploy.

Functions

Creates a BroadcastChannel or WebSocketBroadcastChannel, depending on whether we are running on Deno Deploy or not.

Returns the websocket URL to use. Clients will connect to this URL, and the server will listen on the port specified by this URL.

Creates a logger with a label. Can extract relevant label from import.meta.url if supplied.

Polyfills the globalThis with a BroadcastChannel implementation, if one is not already present.

Interfaces

What BroadcastChannel (if available) looks like, and what WebSocketBroadcastChannel implements.

A https://deno.land/x/quiet_debug logger, with an extra method to create labelled sub-loggers.