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

tynoengine.js

v1.0.3

Published

A powerful, flexible Discord bot engine — commands, interactions, plugins, database, scheduler, i18n, pagination, TynoCard, and more.

Readme

TynoEngine.js

A simple, flexible Discord bot engine built on discord.js.

Installation

npm install tynoengine.js

Quick Start

import { Bot } from "tynoengine.js";

const bot = new Bot({ token: "YOUR_BOT_TOKEN" });

bot.start();

Or use a .env file — no extra setup needed, it's loaded automatically:

# .env
BOT_TOKEN=YOUR_BOT_TOKEN
const bot = new Bot({ token: process.env.BOT_TOKEN });

Commands

Register slash commands — they're automatically synced with Discord on startup:

bot.addCommand({
  name: "ping",
  description: "Replies with Pong!",
  execute: async (interaction) => {
    await interaction.reply("Pong! 🏓");
  },
});

// Ephemeral reply (only visible to the user)
bot.addCommand({
  name: "secret",
  description: "Only you can see this",
  execute: async (interaction) => {
    await interaction.reply({ content: "Shhh 🤫", ephemeral: true });
  },
});

Events

Listen to any discord.js event directly:

bot.on("messageCreate", (message) => {
  if (message.content === "hello") {
    message.reply("Hey there! 👋");
  }
});

bot.on("guildMemberAdd", (member) => {
  console.log(`${member.user.tag} joined the server`);
});

Plugins

Break your bot into reusable, self-contained modules:

// plugins/greet.ts
import { Plugin } from "tynoengine.js";

const greetPlugin: Plugin = {
  name: "greet",
  setup(bot) {
    bot.addCommand({
      name: "greet",
      description: "Say hello",
      execute: (i) => i.reply("Hello! 👋"),
    });
  },
};

export default greetPlugin;
// Load a single plugin
bot.use(greetPlugin);

// Load all plugins from a folder automatically
bot.loadPlugins("./plugins");

Adapters

Choose the runtime that fits your infrastructure:

GatewayAdapter (default)

WebSocket connection — for regular servers, VPS, or always-on hosting.

import { Bot, GatewayAdapter } from "tynoengine.js";

const bot = new Bot({
  token: "...",
  adapter: new GatewayAdapter(), // this is the default
});

bot.start();

ContainerAdapter

Extends GatewayAdapter with Docker/Kubernetes support:

  • Graceful shutdown on SIGTERM / SIGINT
  • Health check endpoint for HEALTHCHECK or liveness probes
import { Bot, ContainerAdapter } from "tynoengine.js";

const bot = new Bot({
  token: "...",
  adapter: new ContainerAdapter({ healthPort: 8080 }),
});

bot.start();
// GET http://localhost:8080/ → { status: "ok", uptime: 42, tag: "MyBot#1234" }

Dockerfile example:

FROM node:20-alpine
WORKDIR /app
COPY . .
RUN npm install
HEALTHCHECK --interval=30s CMD wget -qO- http://localhost:8080/ || exit 1
CMD ["node", "index.js"]

LambdaAdapter

Serverless — for AWS Lambda and compatible platforms.

Discord sends HTTP POST requests to your function. No WebSocket connection is opened.

Setup:

  1. Go to the Discord Developer Portal → your app → Interactions Endpoint URL
  2. Set it to your Lambda function URL
  3. Copy your app's Public Key
import { Bot, LambdaAdapter } from "tynoengine.js";

const adapter = new LambdaAdapter({
  publicKey: process.env.DISCORD_PUBLIC_KEY!,
});

const bot = new Bot({ token: process.env.BOT_TOKEN, adapter });

bot.addCommand({
  name: "ping",
  description: "Pong!",
  execute: (i) => i.reply("Pong! 🏓"),
});

await bot.start();

// Export as your Lambda handler
export const handler = bot.getLambdaHandler();

Full Customization

Pass any discord.js ClientOptions for complete control:

import { Bot, GatewayIntentBits, Partials } from "tynoengine.js";

const bot = new Bot({
  token: "...",
  debug: true,
  intents: [
    GatewayIntentBits.Guilds,
    GatewayIntentBits.GuildMessages,
    GatewayIntentBits.MessageContent,
  ],
  clientOptions: {
    partials: [Partials.Message],
    rest: { timeout: 15_000 },
  },
});

Access the raw discord.js client for anything TynoEngine doesn't cover yet:

const client = bot.getClient();

Chaining

All setup methods are chainable:

const bot = new Bot({ token: "..." });

bot
  .addCommand({ name: "ping", description: "Pong!", execute: (i) => i.reply("Pong!") })
  .addCommand({ name: "help", description: "Help", execute: (i) => i.reply("...") })
  .on("messageCreate", (msg) => console.log(msg.content))
  .use(greetPlugin)
  .start();

API

new Bot(options)

| Option | Type | Description | | --------------- | --------------------- | -------------------------------------------------------- | | token | string | Bot token. Falls back to BOT_TOKEN env var. | | intents | GatewayIntentBits[] | Gateway intents (default: [Guilds]) | | clientOptions | ClientOptions | Any extra discord.js client options | | debug | boolean | Enable verbose logging (default: false) | | adapter | BotAdapter | GatewayAdapter | ContainerAdapter | LambdaAdapter |

Methods

| Method | Description | | ------------------------------- | ---------------------------------------------------- | | bot.start() | Connect to Discord | | bot.stop() | Disconnect gracefully | | bot.addCommand(definition) | Register a slash command | | bot.on(event, listener) | Listen to a discord.js event | | bot.use(plugin) | Load a plugin | | bot.loadPlugins(dir) | Load all plugins from a directory | | bot.getLambdaHandler() | Get serverless handler (requires LambdaAdapter) | | bot.getClient() | Access the raw discord.js Client |


Requirements

  • Node.js 16.11.0 or higher

License

MIT