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

discgen-cli

v2.0.1

Published

Generate a typed Discord bot starter in seconds.

Readme

discgen-cli

Generate a typed Discord.js v14 bot starter without assembling the project by hand. The interactive wizard creates strict TypeScript, command and event loaders, optional feature packs, databases, CI, and project metadata for future tooling.

Requirements

  • Node.js >=24
  • npm, pnpm, Bun, or Yarn for generated projects
  • A Discord application and bot token

Quick start

npx discgen-cli my-bot
cd my-bot
cp .env.example .env
npm run deploy
npm run dev

Set DISCORD_TOKEN and CLIENT_ID in .env before starting the bot. Run the wizard without a name with npx discgen-cli, or preview its complete output with --dry-run.

npx discgen-cli my-bot --output ./apps/bots/my-bot
npx discgen-cli my-bot --template full --no-install --no-git
discgen-cli list

CLI reference

discgen-cli [name] [options]

| Option | Description | | --------------------- | ------------------------------------------ | | --template <preset> | Use basic, moderation, or full | | --output <dir> | Scaffold into an explicit output directory | | --no-install | Do not install dependencies | | --no-git | Do not initialize Git | | --dry-run | Print generated paths without writes |

discgen-cli list prints the supported presets, command modes, feature packs, databases, and single-file generator types.

Add a file to an existing project

discgen-cli generate <type> [name] [options]
discgen-cli g <type> [name] [options]

Supported types are command, event, button, select, modal, guard, and service. Common aliases include cmd, evt, btn, sel, and svc.

discgen-cli g command greet --category utility
discgen-cli g command greet --prefix
discgen-cli g event guildMemberAdd
discgen-cli g button confirm --dry-run

Project names, generated names, and categories are validated before paths are constructed. They cannot contain traversal sequences, separators, or Windows reserved device names.

Wizard choices

| Choice | Values | | --------------- | ------------------------------------------------------------------- | | Command mode | Slash, Prefix, Both | | Features | Moderation, Utility, Fun, Economy, Music, Components, i18n, Logging | | Database | None, SQLite, PostgreSQL, MongoDB | | Package manager | npm, pnpm, Bun, Yarn |

The slash-command path is feature-complete. Prefix and Both projects receive typed help and ping commands; parity for optional feature packs is tracked in TODO.md.

Generated project

Generated projects include strict NodeNext TypeScript, dynamic command/event/interaction loaders, environment validation, logging, cooldown, embed and paginator helpers, a GitHub Actions workflow, and .discgen.json metadata. Production builds use tsc to preserve every dynamically loaded module in dist/.

Database choices add the required dependencies, environment example, initialization, and schema:

  • SQLite: better-sqlite3
  • PostgreSQL: pg and drizzle-orm
  • MongoDB: mongoose

Economy

Economy commands persist balances and daily-claim timestamps with a selected database. Daily claims are serialized per user: SQLite uses a transaction, PostgreSQL an advisory transaction lock, and MongoDB a conditional update with duplicate-key recovery. Without a database, one shared in-memory store makes daily rewards immediately visible to /balance and /leaderboard; that state resets when the bot restarts.

Scripts

This repository

npm run lint
npm run typecheck
npm run test -- --run
npm run build

Generated projects

| Script | Purpose | | ------------------- | ------------------------------------------- | | npm run dev | Run with tsx watch | | npm run typecheck | Check TypeScript without emitting output | | npm run build | Compile the complete src/ tree with tsc | | npm start | Run dist/index.js | | npm run deploy | Register slash commands |

Project documentation

Contributing

Run lint, typecheck, tests, and build before opening a focused Conventional Commit. Review intended snapshot changes and keep the changelog and TODO backlog aligned with behavior.

License

MIT