npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

trixxy-stream

v1.0.0

Published

A package for TikTok and YouTube stream notifications.

Readme

trixxy-stream

A Discord.js package for sending TikTok and YouTube stream live notifications.

Installation

npm install trixxy-stream

Dependencies

This package relies on the following npm packages:

  • discord.js
  • axios
  • cheerio
  • ytsr (for YouTube stream checking)

Make sure these are installed in your project.

Usage

Here's how to use the TrixxyStreamNotifications class in your Discord bot:

const { Client, GatewayIntentBits } = require('discord.js');
const TrixxyStreamNotifications = require('trixxy-stream');

const client = new Client({
  intents: [
    GatewayIntentBits.Guilds,
    GatewayIntentBits.GuildMessages,
    GatewayIntentBits.MessageContent,
  ],
});

client.on('ready', () => {
  console.log(`Logged in as ${client.user.tag}!`);

  const streamMonitor = new TrixxyStreamNotifications(client, 60000); // Check every 60 seconds

  // Add a TikTok user to monitor (replace 'tiktokusername' and 'YOUR_DISCORD_CHANNEL_ID')
  streamMonitor.addStream('tiktokusername', 'tiktok', 'YOUR_DISCORD_CHANNEL_ID');

  // Add a YouTube channel to monitor (replace 'youtubechannelid' and 'YOUR_DISCORD_CHANNEL_ID')
  // You can find YouTube channel IDs in the URL (e.g., youtube.com/channel/UC-lHJZR3Gqxm24_Vd_D_smQ)
  streamMonitor.addStream('UC-lHJZR3Gqxm24_Vd_D_smQ', 'youtube', 'YOUR_DISCORD_CHANNEL_ID');

  streamMonitor.startMonitoring();
});

client.login('YOUR_BOT_TOKEN');

TrixxyStreamNotifications Class Methods

constructor(client, interval = 60000)

Initializes the stream notification monitor.

  • client: An instance of discord.js.Client.
  • interval: (Optional) The interval in milliseconds to check for stream status updates. Defaults to 60000 (1 minute).

addStream(userId, platform, discordChannelId)

Adds a stream to be monitored for live status.

  • userId: For TikTok, this is the username (e.g., tiktokusername). For YouTube, this is the YouTube channel ID (e.g., UC-lHJZR3Gqxm24_Vd_D_smQ).
  • platform: The streaming platform. Must be either 'tiktok' or 'youtube'.
  • discordChannelId: The ID of the Discord channel where notifications should be sent.

Throws: Error if an invalid platform is specified.

startMonitoring()

Starts the periodic checking of stream statuses. If monitoring is already running, it will do nothing.

stopMonitoring()

Stops the periodic checking of stream statuses. If monitoring is not running, it will do nothing.

checkStreams() (Private Method)

This method is called internally by startMonitoring at the specified interval. It checks the live status of all added streams and sends notifications if a stream goes live.

sendNotification(userId, platform, discordChannelId, title, url) (Private Method)

This method is called internally to send a Discord embed notification when a stream goes live.

Important Notes on TikTok Monitoring

Monitoring TikTok live streams reliably is challenging due to the lack of official public APIs for live status. The current implementation relies on web scraping, which is highly susceptible to breaking if TikTok changes its website structure. For a more robust solution, you might need to explore third-party services or unofficial APIs, which come with their own risks and limitations.

YouTube monitoring is more reliable due to better public data access, though still relies on ytsr for searching channel information.