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

mander

v1.1.0

Published

A simplified version of commander.js with automatic interactive mode and i18n support

Readme

mander

A simplified version of commander.js with automatic interactive mode and internationalization support (Chinese/English).

Features

  • Intuitive command line parsing
  • Support for subcommands
  • Option definitions (short and long options)
  • Automatic help generation
  • Version information
  • Interactive mode when no arguments are provided
  • Internationalization support (Chinese (zh) and English (en)), default to English

Installation

npm install mander

Basic Usage

import { mander } from 'mander';

// Create a command with default language (English) const program = mander('myapp') .description('A sample command line tool') .version('1.0.0') .option('-d, --debug', 'Enable debug mode', false) .option('-o, --output ', 'Output file path', 'output.txt');

// Create a command with Chinese language const chineseProgram = mander('myapp', 'zh') .description('一个示例命令行工具') .version('1.0.0') .option('-d, --debug', '启用调试模式', false) .option('-o, --output ', '输出文件路径', 'output.txt');

// Add a subcommand program.command('create', 'Create a new file') .arguments(' [template]') .option('-t, --type ', 'File type', 'txt') .action((options, filename, template) => { console.log(Creating ${filename}.${options.type}); // Your logic here });

// Change language dynamically program.language('zh');

// Parse arguments program.parse();

API

mander(name: string, language?: 'zh' | 'en')

Create a new command instance with the given name and optional language. Default language is English ('en').

.description(text: string)

Set the description for the command.

.version(version: string)

Set the version number for the command. When set, the -v and --version options are automatically added.

.language(lang: 'zh' | 'en')

Set the language for the command and all its subcommands.

.option(flags: string, description: string, defaultValue?: any)

Define a command option. Flags can be a combination of short and long options (e.g., -d, --debug).

.command(name: string, description: string)

Create a new subcommand with the given name and description.

.arguments(desc: string)

Define the arguments for the command. Use <arg> for required arguments and [arg] for optional arguments.

.action(callback: (...args: any[]) => void | Promise)

Set the action callback to be executed when the command is invoked. The callback receives the parsed options followed by the arguments.

.parse(args?: string[])

Parse the command line arguments. If no arguments are provided, it uses process.argv.slice(2). If no arguments are present, interactive mode is triggered.

Interactive Mode

When no command line arguments are provided, mander automatically enters interactive mode, guiding the user through:

  1. Selecting a command (if subcommands exist)
  2. Providing required arguments
  3. Setting options

The interactive prompts will be displayed in the current language setting.

Internationalization

Mander supports both Chinese (zh) and English (en):

  • Default language is English ('en')
  • You can specify language when creating a command: mander('myapp', 'zh')
  • You can change language dynamically with .language('zh')

All built-in messages, help information, and interactive prompts will be displayed in the selected language.

License

MIT