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

hanma

v0.3.4

Published

CLI to download backend snippets

Readme

⚔️ Hanma CLI


What is Hanma?

Hanma is a specialized CLI engine designed to eliminate the tedious "boilerplate phase" of backend development. Inspired by tools like shadcn/ui but built for the server-side, Hanma doesn't provide a library; it provides source code.

Why Hanma?

  • Zero Lock-in: You own the code. Once added, it's just local files in your project. No runtime dependencies on Hanma.
  • Composable Architecture: Mix and match templates. Need Express with Drizzle, Clerk Auth, and Socket.io? Hanma builds it for you.
  • Framework Aware: Hanma understands whether you're using Express, Hono, or Elysia and adapts the code it gives you accordingly.
  • Production Grade: Every snippet and module following industry best practices for security, types, and structure.
  • Offline Aware & Faster: Registry data is cached locally, allowing for instant lookups and fallback when offline.

Core Concepts

To get the most out of Hanma, it helps to understand the three types of code it provides:

1. Composable Templates (create)

Scaffolding a project isn't just picking a framework. It's picking a stack. The create command uses a composable engine that stitches together base frameworks with database ORMs, auth handlers, and middleware setups during initialization.

2. Modules (module)

A module is a complex, multi-file feature. Adding a "Better Auth" module doesn't just add one file; it adds routes, middleware, types, and schema files, ensuring everything is wired up correctly from the start.

3. Snippets (add)

The building blocks. Individual files or functions for specific tasks—CORS setup, JWT utilities, validation schemas, or custom error handlers.


Quick Start

# Start the interactive project builder
npx hanma create my-project

# Add a module to an existing project
cd my-project
npx hanma mod drizzle-postgres

# Inject a specific utility snippet
npx hanma add logger

# Sync all registry metadata and verify cache
npx hanma sync --info

Detailed Command Reference

create [name]

The entry point for new projects.

| Flag | Description | |:---|:---| | --framework <fw> | Force a specific framework (e.g., express, hono, elysia) | | --database <db> | Pre-select database (e.g., drizzle-postgres, prisma-mysql) | | --auth <auth> | Pre-select auth provider (e.g., better-auth, clerk, jwt) | | --pm <package-manager> | Select package manager (only shows installed ones) | | --skip-install | Scaffold only, don't run the installer |

Note: The CLI automatically detects which package managers are installed on your system and only shows those as options.

add [snippets...]

Smart snippet injection. Hanma reads your hanma.json to ensure you get the right code for your framework.

# Multi-select interactively (recommened)
hanma add

# Category filtered select
hanma add --category middleware

show <type> [name]

The Discovery Engine. Browse the registry without leaving your terminal.

  • hanma show snippets: List all snippets for your detected framework.
  • hanma show templates: Browse the scaffolding library.
  • hanma show modules: See complex multi-file features.
  • hanma show tooling: Browse dev-tools configurations.

sync

Registry & Cache Management. Keep your local registry metadata updated.

  • hanma sync: Refresh all registry metadata from the remote source.
  • hanma sync --info: View local cache statistics (size, files, last update).
  • hanma sync --clear: Wipe the local cache to force a fresh pull on next command.

update

Keep your CLI up to date.

# Check for updates
hanma update --check

# Update to latest version
hanma update

Compatibility Matrix

Hanma is designed to grow. Here is the current state of support:

| Feature Area | Express | Hono | Elysia | Fastify | |:---|:---:|:---:|:---:|:---:| | Core Scaffolding | ✅ | ✅ | ✅ | 🚧 | | Snippet Library | ✅ | ✅ | ✅ | ✅ | | Auth Modules | ✅ | ✅ | ✅ | 🚧 | | DB Integrations | ✅ | ✅ | ✅ | ✅ | | Tooling (Biome, etc) | ✅ | ✅ | ✅ | ✅ |


⚙️ How it Works: hanma.json

When you run hanma init or hanma create, a small configuration file is created. This is the brain of the CLI—it keeps Hanma "framework aware".

{
  "framework": "express",
  "componentsPath": "src",
  "utilsPath": "src/utils"
}
  • Framework Awareness: When you run hanma add cors, Hanma checks this file. If it's express, it fetches the Express middleware. If it's hono, it fetches the Hono version.
  • Custom Paths: Tired of src/? Change componentsPath to ./lib and Hanma will respect it.

Documentation & Resources


License

MIT © Gaurav Kumar