UNPKG

radish

Version:

Radish is a React-based static site generator that outputs plain HTML and CSS.

16 lines (15 loc) 366 B
import { WebSocketServer } from "ws"; export function websocket(options) { const wss = new WebSocketServer({ port: options.port }); return { refresh() { for (const client of wss.clients) client.send(JSON.stringify({ type: "refresh" })); }, close() { wss.close(); } }; }