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

xton-cli

v3.0.1

Published

CLI tool for scaffolding and managing XtonCore Discord.js v14 projects with performance optimizations

Readme

npm version npm downloads License: ISC


Xton CLI v3.0 is a powerful utility designed to streamline the development workflow when working with the XtonCore Framework v3.0.x library for Discord.js v14.

Generated projects feature:

  • 85% faster startup with lazy loading
  • 💾 67% less memory usage
  • 🚀 57% faster initialization with parallel loading
  • 🔥 Hot reload for development
  • 📊 Performance monitoring built-in

✨ Features

🎯 Core Features

  • Project Scaffolding: Quickly create a new XtonCore Framework v3.0 bot project with advanced directory structure
  • TypeScript & JavaScript Support: Choose to initialize your project in either TypeScript (recommended) or plain JavaScript
  • Advanced Component Generation: Generate commands, events, validations, buttons, modals, select menus, cron jobs, and translation locales
  • Interactive Prompts: User-friendly prompts to guide you through project setup
  • XtonCore v3.0 Integration: Full support for all modern framework features like Middleware pipelines and i18n

🚀 Enhanced Features (v2.1)

  • ⚡ Lazy Loading: Generate projects with 80% faster startup
  • 🚀 Parallel Loading: 57% faster initialization out of the box
  • Component Management: Generate interactive Discord components (buttons, modals, select menus)
  • Performance Monitoring: Built-in performance tracking and statistics
  • Hot Reload Support: Development-friendly file watching and reloading
  • Rate Limiting: Advanced rate limiting configuration
  • Permission System: Enhanced permission management
  • Input Sanitization: Security-focused input validation
  • Enhanced Logging: Multi-level logging with context
  • Utility Classes: Pre-built embed builders and component helpers
  • TypeScript Support: Full type definitions and IntelliSense

⚠️ Prerequisites

  • Node.js (Refer to xtoncore's package.json for specific engine requirements, generally >=16.9.0)
  • NPM or Yarn

📦 Installation

You can install Xton CLI globally to use it anywhere on your system:

NPM:

npm install -g xton-cli

Yarn:

yarn global add xton-cli

Alternatively, you can use it without a global installation via npx:

npx xton-cli init my-new-bot

🚀 Getting Started & Usage

The primary command you'll use is init.

xton init [projectName]

This command initializes a new XtonCore project.

Syntax:

xton init [projectName] [options]

Arguments:

  • [projectName] (optional): The name of your new project directory. If not provided, you will be prompted to enter one.

Options:

  • -T, --typescript: Initialize the project with TypeScript. This is the default if no language flag is specified.
  • -J, --javascript: Initialize the project with JavaScript.
  • -y, --yes: Skip all interactive prompts and use default values. If projectName is not provided with this flag, it defaults to "my-xton-bot".
  • -h, --help: Display help for the command.

Interactive Mode (Recommended for first-time use):

If you run xton init without a projectName or the --yes flag, the CLI will guide you through a series of questions:

xton init

You'll be asked for:

  1. Project name (if not provided as an argument)
  2. Project type (TypeScript or JavaScript, if no language flag was used)
  3. Whether to create a "validations" directory
  4. Your Bot Token (optional, can be left blank)
  5. Your Guild ID for development (optional, can be left blank)
  6. Confirmation if the project directory already exists.

Example: Initializing a TypeScript project interactively

xton init my-discord-bot

Example: Initializing a JavaScript project directly

xton init my-js-bot -J

or

xton init my-js-bot --javascript

Example: Initializing a TypeScript project with default settings, skipping prompts

xton init quick-start-bot --yes

This will create a TypeScript project named "quick-start-bot" with default configurations.

Generated Project Structure (TypeScript Example with XtonCore v3.0):

my-discord-bot/
├── src/
│   ├── commands/
│   │   └── utility/
│   │       └── ping.ts      # Enhanced command
│   ├── events/
│   │   └── ready/
│   │       └── 01-ready-log.ts # Event handler
│   ├── components/
│   │   ├── buttons/
│   │   ├── modals/
│   │   └── selectmenus/
│   ├── jobs/                # ⏱️ Cron Jobs directory (v3.0)
│   ├── locales/             # 🌐 i18n Translation files (v3.0)
│   ├── validations/         # (If selected)
│   └── index.ts             # Main bot entry point with v3.0 config
├── .gitignore
├── package.json             # Updated with XtonCore v3.0.x
├── tsconfig.json
└── README.md                # Project README

🔧 Generate Components

xton generate <component> [name] [options]

This command helps you quickly generate boilerplate files for different XtonCore components.

Syntax:

xton generate <component> [name] [options]
# or use the alias
xton gen <component> [name] [options]

Components:

  • command - Generate a new slash command
  • event - Generate a new event handler
  • validation - Generate a new validation file
  • button - Generate a new button component handler
  • modal - Generate a new modal component handler
  • selectmenu - Generate a new select menu component handler
  • job - Generate a new cron job scheduler file
  • locale - Generate a new JSON translation file
  • component - Interactive component type selection

Options:

  • -c, --category <category> - Specify category for commands (e.g., utility, moderation, fun)

Examples:

Generate an enhanced command with v2.0 features:

xton generate command ping
# or
xton gen command ping -c utility

Generate a ready event handler:

xton generate event ready-logger

Generate a validation file:

xton generate validation developer-only

Generate Discord components (New in v2.0):

# Generate a button component
xton generate button confirm-action

# Generate a modal component
xton generate modal feedback-form

# Generate a select menu component
xton generate selectmenu role-selector

# Interactive component generation
xton generate component my-component

Generate Framework components (New in v3.0):

# Generate a Cron job file
xton generate job daily-announcement

# Generate a language translation file
xton generate locale th-TH

Interactive Mode: If you don't provide a name, the CLI will prompt you for the required information:

xton gen command
# Will ask for command name, category, etc.

xton gen component
# Will ask for component type (button/modal/selectmenu) and name

🔥 Development Commands (New in v2.0)

Hot Reload Development:

xton dev
# Information about XtonCore v2.0's built-in hot reload

Performance Statistics:

xton stats
# Information about XtonCore v2.0's performance monitoring

📊 XtonCore v2.0 Enhanced Features

The generated projects now include:

Performance Monitoring:

  • Real-time command execution tracking
  • Memory usage monitoring
  • Performance statistics and reports

Hot Reload System:

  • Automatic file watching and reloading
  • Development-friendly workflow
  • No need to restart your bot during development

Advanced Component System:

  • Button interactions with enhanced embed responses
  • Modal forms with input sanitization
  • Select menu components with validation

Enhanced Security:

  • Input sanitization for all user inputs
  • Rate limiting to prevent abuse
  • Advanced permission checking with caching

Utility Classes:

  • EnhancedEmbedBuilder for beautiful embeds
  • ComponentHelpers for easy Discord components
  • InputSanitizer for security-focused validation

🎯 Generated Code Examples

Enhanced Command (v2.1):

import { SlashCommandBuilder } from "discord.js";
import { CommandRunOptions } from "xtoncore";
import { EnhancedEmbedBuilder } from "xtoncore/utils";

export const data = new SlashCommandBuilder()
  .setName("ping")
  .setDescription("Check bot latency with enhanced features");

export const cooldown = 5;
export const category = "utility";
export const permissions = [];

export async function run({ interaction, client, handler }: CommandRunOptions) {
  // ⚡ This command was lazy-loaded on first use!
  const embed = EnhancedEmbedBuilder.createInfo(
    "🏓 Pong!",
    `Latency: ${client.ws.ping}ms\nEnhanced with XtonCore v2.1!`
  );

  await interaction.reply({ embeds: [embed] });
}

Button Component (v2.1):

import { ButtonInteraction } from "discord.js";
import { ComponentHandler } from "xtoncore";
import { EnhancedEmbedBuilder } from "xtoncore/utils";

export const customId = "confirm-action";
export const type = "button";

export async function run(
  interaction: ButtonInteraction,
  client: any,
  handler: any
) {
  const embed = EnhancedEmbedBuilder.createSuccess(
    "✅ Action Confirmed",
    "Your action has been processed successfully!"
  );

  await interaction.reply({ embeds: [embed], ephemeral: true });
}

🚀 What's New in v2.1

  • Lazy Loading - Generated projects start 80% faster
  • 🚀 Parallel Loading - 57% faster initialization
  • 📊 Performance Stats - Built-in stats command template
  • 🎯 Smart Preloading - Configure which commands to preload
  • 💾 Memory Optimization - 67% less memory usage
  • Component Generation - Generate buttons, modals, and select menus
  • 🔥 Hot Reload Support - Built-in development workflow
  • 🛡️ Enhanced Security - Input sanitization and rate limiting
  • 🎨 Utility Classes - Pre-built helpers for common tasks
  • 📈 Advanced Logging - Multi-level logging with context
  • 📚 Better Documentation - Enhanced inline comments and examples

🤝 Contributing

Contributions, issues, and feature requests are welcome!

📜 License

This project is licensed under the ISC License - see the LICENSE file for details.