
Security News
Package Maintainers Call for Improvements to GitHub’s New npm Security Plan
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
@jprochazk/twitch_irc
Advanced tools
Twitch chat client
import * as TwitchIrc from "https://deno.land/x/twitch_irc/mod.ts";
const channel = /*...*/;
const nick = /*...*/;
const pass = /*...*/;
const client = new TwitchIrc.Client({
credentials: { nick, pass }
});
client.on("privmsg", ({ user, message }) => {
console.log(`${user.login}: ${message}`);
});
client.on("open", () => {
client.join(channel);
});
$ npm install twitch_irc@npm:@jprochazk/twitch_irc
ESM:
// index.mjs
// or index.js, but with "type":"module" in package.json
import * as TwitchIrc from "twitch_irc";
const channel = /*...*/;
const nick = /*...*/;
const pass = /*...*/;
const client = new TwitchIrc.Client({
credentials: { nick, pass }
});
client.on("privmsg", ({ user, message }) => {
console.log(`${user.login}: ${message}`);
});
client.on("open", () => {
client.join(channel);
});
CommonJS:
// index.js
const TwitchIrc = require("twitch_irc");
const channel = /*...*/;
const nick = /*...*/;
const pass = /*...*/;
const client = new TwitchIrc.Client({
credentials: { nick, pass }
});
client.on("privmsg", ({ user, message }) => {
console.log(`${user.login}: ${message}`);
});
client.on("open", () => {
client.join(channel);
});
PRIVMSG
Specify the --inspect-brk
flag to inspect any of the examples using developer
tools. For example, for Chrome it's chrome://inspect
->
Open dedicated DevTools for Node
. The client is available on the window object
as window.client
.
Requires the CHANNEL
environment variable to be specified in the format
#<name>
, e.g. #jtv
.
$ deno run \
--allow-env=CHANNEL \
--allow-net=irc-ws.chat.twitch.tv \
https://deno.land/x/twitch_irc/examples/logs.ts
Requires three environment variables:
CHANNEL
in the format #<name>
, e.g. #jtv
.TOKEN
in the format oauth:<token>
, e.g. oauth:abcdefg0123456789
.
You can generate one here.LOGIN
, which is the username of the account you used to generate TOKEN
.The bot will join CHANNEL
upon connecting, and you can type !ping
in command
to have it respond to you. It will also join its own channel.
$ deno run \
--allow-env=CHANNEL,LOGIN,TOKEN \
--allow-net=irc-ws.chat.twitch.tv \
https://deno.land/x/twitch_irc/examples/bot.ts
version
according to semverdeno run -A ./scripts/build_npm.ts <version>
using the same version
cd npm && npm publish --access=public
Some tag values can have a space in them, and the
example parser by Twitch will
not correctly handle that case. [^2]: The library uses string and template
literal types extensively, for example to ensure that a channel has the #
prefix - similar usage of these advanced type features simplifies the internals
of the library greatly, and contributes towards making it less error prone to
use. ↩
FAQs
Twitch chat client
We found that @jprochazk/twitch_irc demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.