Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/websocket_broadcastchannel/mod.ts>createBroadcastChannel

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

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

Parameters

name: string

The name of the channel.

optional
url: string | URL = [UNSUPPORTED]

WebSocket url to connect to or listen as, if not on Deno Deploy. Defaults to defaultWebSocketUrl() if not specified.