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

@zbrlang/zbr

v1.6.0

Published

ZBR CLI, A simple and powerful Discord bot scripting engine.

Downloads

2,607

Readme

ZBR

ZBR is a scripting language for Discord bots powered by a high-performance Rust runtime engine. You write commands as plain .zbr files using ZBR functions, no boilerplate, no event handlers, no framework knowledge required.

Quick Start

Get your bot up and running in seconds:

Option 1: Webapp Editor (Recommended)

Head over to the ZBR Webapp for a zero-setup development experience.

  1. Build your commands, manage variables, and tweak settings visually.
  2. Press Run to launch your bot instantly in the cloud for testing.
  3. Your bot is now live for testing!

Note: The Webapp "Run" button is strictly for rapid prototyping and interactive testing. For 24/7 production hosting, you must export your project as a ZIP and use the CLI.

Option 2: CLI

  1. Install the CLI globally:

    npm i -g @zbrlang/zbr
  2. Initialize a new project:

    zbr init my-bot

    This creates your commands/ folder, zbr.json config, and a .env file inside of my-bot.

  3. Navigate to your project directory

    cd my-bot
  4. Configure your token: Open the .env file and paste your Discord Bot Token.

  5. Run the engine:

    zbr run

    Your bot is now live and loading scripts from the commands/ directory!

Webapp Editor

For those who prefer a visual development environment, the ZBR Webapp allows you to build and test your bot entirely in your browser.

  • Instant Prototyping: Write code and launch your bot with a single click using the built-in cloud runner, no local setup required.
  • Visual Interface: Easily design your bot logic, manage variables, and configure settings without touching a terminal.
  • Hybrid Workflow: Use the Webapp for rapid development and testing, then export your project as a ZIP to host it permanently on your own server using the ZBR CLI.

What it looks like

#trigger !rank
#name Rank Command
#type prefix

Zvar{xp;ZgetUserVar{xp}}
Zvar{level;ZgetUserVar{level}}

Ztitle{Zusername's Rank}
Zdescription{Level: Zvar{level}
XP: Zvar{xp}}
Zcolor{#5865F2}
ZaddField{Server Rank;#Zvar{rank};true}
#trigger /ban
#name Ban Command
#type slash
#description Ban a user from the server
#option user|User to ban|user|required
#option reason|Reason for the ban|string|optional

ZonlyIf{ZisAdmin==true;You need administrator permission to use this command}
Zban{Zoption{user};Zoption{reason}}
Banned Zoption{user}.
#trigger onInteraction{confirm_ban}
#name Confirm Ban Handler
#type interaction

Zephemeral
Zban{ZgetServerVar{pending_ban}}
Done.

How it works

ZBR is powered by a high-performance runtime engine built in Rust that parses and executes bot logic, and is distributed as a convenient npm CLI.

  • The CLI (zbr): Acts as your project manager and binary launcher.
  • The Engine: A bundled Rust binary that handles the Discord gateway, parses your .zbr files, and executes logic in real-time.
  • Hot Reloading: The engine watches your commands/ folder. Save a .zbr file, and the changes are live instantly without restarting.

Commands are plain text files. Each file has a header section (lines starting with #) that defines the trigger, name, and type, followed by the ZBR code that runs when the command is invoked.

Command types

| Type | Trigger format | When it runs | |---|---|---| | prefix | !command | When a message starts with the trigger | | slash | /command | When a slash command is invoked | | interaction | onInteraction{id?} | When a button, select menu, or modal is submitted | | event | onMessage, onMemberJoin, etc. | When a Discord gateway event fires |

Function syntax

Functions are called with a Z prefix, followed by the function name and arguments in {} separated by ;.

ZfunctionName{arg1;arg2;arg3}

Functions can be nested — the inner call evaluates first:

Zsum{ZgetUserVar{xp};100}

Plain text on a line is output as-is. Functions and text can be mixed:

You have Zsum{ZgetUserVar{xp};0} XP.

Lines starting with // are comments.

What's included

  • Embeds: Ztitle, Zdescription, Zcolor, ZaddField, ZsendEmbed, Zauthor, Zfooter
  • HTTP: ZhttpGet, ZhttpPost, ZhttpPut, ZhttpPatch, ZhttpDelete, ZhttpResult
  • Moderation: Zban, Zkick, Zmute, Ztimeout, Zclear, Zunban, ZvoiceKick
  • Components: ZaddButton, ZaddSelectMenuOption, ZaddTextInput, ZaddUserSelect, ZeditButton, ZremoveComponent
  • Automod: ZautomodRule, ZautomodRuleCreate, ZautomodRuleEdit, ZautomodRuleDelete, ZautomodRules
  • Servers: ZserverModify, ZserverLockdown, ZeditWelcomeScreen, ZwelcomeScreen, ZboostCount, ZboostLevel
  • Channels: ZcreateChannel, ZdeleteChannels, ZmodifyChannel, ZsyncPerms, ZchannelExists, ZchannelName, ZslowMode
  • Roles: ZcreateRole, ZdeleteRole, ZmodifyRole, ZroleMembers, ZroleExists, ZhasRole

...and 32+ more — see the full function reference.

Example commands

The commands/ folder contains ready-to-run examples:

| File | Type | What it does | |---|---|---| | ping.zbr | slash | Replies with pong and echoes your input | | hello.zbr | prefix | Greets the user with their name, channel, and server | | rank.zbr | prefix | Reads user variables and sends a rank embed | | eval.zbr | prefix | Evaluates ZBR code on the fly |

Built with

License

All Rights Reserved, see LICENSE.