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

@haitrungle/create-cli

v0.0.3

Published

Scaffold a modern Node.js CLI app

Downloads

254

Readme

create-cli

Scaffold a modern and minimal Node.js CLI app.

This is the template I use whenever I have to write a Node.js script. I prioritize modern libraries for their focus on performance, good typing support, and sane default configuration. The catch is that this template is only compatible with Node.js >=20 and uses the preview version of TypeScript, but for internal and personal tools, those requirements are acceptable to me.

This template is heavily inspired by the post My JS CLI Stack 2025 by ryoppippi. Thank you for sharing!

Usage

npx @haitrungle/create-cli <project-name>

# Or follow the prompts
npx @haitrungle/create-cli 

Then, refer to gunshi docs:

import { define, cli } from "gunshi";

// Define a subcommand
const hello = define({
  name: "hello",
  description: "Say hello",
  args: {
    name: {
      type: "string",
      short: "n",
      description: "Name to greet",
      default: "World",
    },
  },
  run: (ctx) => {
    console.log(`Hello, ${ctx.values.name}!`);
  },
});

// Define the entry point
const main = define({
  name: "my-nice-cli",
  description: "My little CLI app",
  run: () => {
    console.log("Welcome to my-nice-cli! Run with --help to see commands.");
  },
});

// Wire up and start the CLI
await cli(process.argv.slice(2), main, {
  name: "my-nice-cli",
  version: "0.0.1",
  description: "My little CLI app",
  subCommands: {
    hello,
  },
});

Dependencies

  • gunshi: declarative CLI definition with type information out of the box
  • oxfmt and oxlint: formatting and linting
  • vitest: standard choice for testing
  • @typescript/native-preview: TypeScript 7.0 preview, fast and stable in my usage
  • @types/node: type declarations for Node.js
  • tsdown: fast bundler that is both configurable and extensible

The heaviest library here is tsdown at 26 MB. It is possible to omit tsdown if you use Node.js >=24 with type stripping, but you have to annotate all type imports with the type keyword and set allowImportingTsExtensions to true in "tsconfig.json". Then, remove tsdown and the build script from "package.json" and delete "tsdown.config.ts", and you are good to go.

The second heaviest library here is vitest at 21 MB. I hear you: I don't like testing something that feels like an one-off script either. Still, most CLI tools I write are ran more than once anyways, and since they are the easiest kind of program to test, I bit the bullet and include it to make myself feel good. The fact that coding agents work best with tests to keep them in track is the cherry on top. However, you can also delete it just as easily as with tsdown, should you prefer.