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

syntx.js

v1.0.5

Published

Create Discord bots faster and easier with syntx.js

Readme

npm version   npm downloads   License   Node

Syntx.js is an npm package built on top of discord.js that simplifies and accelerates the creation of Discord bots. It uses a JSON-based structure and provides helpers for prefix commands, slash commands, embeds, components, polls, and more.

Requires Node.js ≥ 18.

Installation

npm i syntx.js
# or from GitHub
npm i github:erxproject/syntx.js

Table of contents


Setting up the client

const { ERXClient, Intents } = require("syntx.js")

const client = new ERXClient({
    prefix: "!",
    intents: Intents.All,
    token: "YOUR_DISCORD_BOT_TOKEN",
    clientId: "YOUR_APPLICATION_ID"
})

client.ready(() => {
    console.log(`Bot ${client.bot.user.username} is ready!`)
})

client.start()

| Option | Type | Description | | ---------- | ----------------- | -------------------------------------------------- | | token | string | Your bot token from the Discord Developer Portal. | | intents | number \| array | Gateway intents. Use Intents.All or a bitfield. | | prefix | string | Prefix for message commands (!, ?, $, …). | | clientId | string | Application ID, required for slash commands. | | database | object | Optional database instance (e.g. SyntxDB). |


Prefix commands

Register commands with client.command() and call client.registerCommands() before client.start().

const { ERXClient, Intents, cmd } = require("syntx.js")

const client = new ERXClient({ prefix: "!", intents: Intents.All, token: "TOKEN" })

client.command({
    name: "hi",
    alias: ["hello", "hey"],
    content: async (message) => {
        cmd.message.send({ text: `Hello, ${message.author.username}!` }, message)
    }
})

client.registerCommands()
client.start()

Slash commands

Use SlashCommand to define the command, client.slash() to register it, and client.registerSlashCommands() to deploy it to Discord.

const { ERXClient, Intents, SlashCommand } = require("syntx.js")

const client = new ERXClient({ intents: Intents.All, token: "TOKEN", clientId: "CLIENT_ID" })

client.slash({
    data: new SlashCommand({
        name: "ping",
        description: "Replies with Pong!",
        scope: "global" // or "guild"
    }),
    execute: async (interaction) => {
        await interaction.reply("🏓 Pong!")
    }
})

client.ready(async () => {
    await client.registerSlashCommands()
})

client.start()

Embeds

const { Embed, cmd } = require("syntx.js")

const embed = new Embed()
embed.set({
    title: "Hello!",
    description: "This is an embed.",
    color: "#5865F2",
    footer: "Syntx.js",
    thumbnail: "https://example.com/icon.png"
})
embed.timestamp()

cmd.message.send({ embeds: [embed.build()] }, message)

Components

Buttons

const { Buttons, cmd } = require("syntx.js")

const row = new Buttons()
row.set([
    { label: "Click me!", style: "Primary", id: "btn-click" },
    { label: "Visit", style: "Link", url: "https://example.com" }
])

cmd.message.send({ text: "Press a button:", components: [row.build()] }, message)

Handle the interaction with client.interaction() and activate the listener with client.registerInteractions().

client.interaction({
    id: "btn-click",
    content: async (interaction) => {
        await interaction.reply({ content: "You clicked it!", ephemeral: true })
    }
})

client.registerInteractions()
client.start()

Modals

const { Modal } = require("syntx.js")

const modal = new Modal()
modal.set({
    id: "feedback-modal",
    title: "Send Feedback",
    inputs: [{ id: "feedback-input", label: "Your feedback", style: "paragraph" }]
})

// Show the modal on a button click
client.interaction({
    id: "open-modal",
    content: async (interaction) => {
        await interaction.showModal(modal.build())
    }
})

// Handle the submission
client.modal({
    id: "feedback-modal",
    run: async (interaction) => {
        const feedback = interaction.fields.getTextInputValue("feedback-input")
        await interaction.reply({ content: `Thanks! "${feedback}"`, ephemeral: true })
    }
})

Polls

const { Poll, cmd } = require("syntx.js")

const poll = new Poll()
poll.set({
    question: "Favorite color?",
    answers: [
        { text: "Red",   emoji: "🔴" },
        { text: "Blue",  emoji: "🔵" },
        { text: "Green", emoji: "🟢" }
    ],
    duration: 24,       // hours
    multiselect: false
})

cmd.message.send({ poll: poll.build() }, message)

More information in the documentation.