const ws = new WebSocket(Deno.args[0]) ws.onerror = () => console.error("ws error") ws.onclose = () => console.error("ws closed") ws.onopen = () => { console.log("ws open"); ws.send(JSON.stringify({ t: "register", name: "yt-dlp playlist flattener", sources: ["ytdlp-flatten"] })) ws.send(JSON.stringify({ t: "accept" })) } ws.onmessage = ev => { console.log(ev.data); }