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

lershi-minimal-app

v0.8.0

Published

A CLI tool to scaffold minimal project structures

Readme

lershi-minimal-app

A modern, minimal CLI tool to scaffold new projects with a single command—just like npx create-next-app!

Features

  • Multiple templates (e.g., default, html)
  • Interactive prompts (or -y to skip)
  • Git initialization
  • Dependency installation (npm, yarn, pnpm, bun)
  • Clean, colored output

Project Structure

lershi-minimal-app/
├── src/
│   ├── cli.ts        # CLI entry point: argument parsing, prompts, main logic
│   ├── logger.ts     # Unified logging and spinner output
│   ├── scaffold.ts   # Core logic: copies templates, replaces placeholders
│   ├── utils.ts      # Helper: validates project name
│   └── version.ts    # Auto-generated: contains the CLI version
├── templates/
│   ├── default/      # Default template files
│   └── html/         # HTML template files
├── dist/             # Compiled output (after build)
│   ├── cli.js
│   ├── logger.js
│   ├── scaffold.js
│   ├── utils.js
│   └── version.js
├── README.md         # This file
├── package.json      # Scripts, dependencies, config
└── ...

How Each File Works

  • src/cli.ts: Handles CLI arguments, prompts, and calls the scaffolder. Uses commander, enquirer, and logger.
  • src/logger.ts: Provides colored output and spinners for a great UX.
  • src/scaffold.ts: Copies the chosen template, replaces ${name} placeholders, and returns the new project path.
  • src/utils.ts: Validates the project name and checks for existing directories.
  • src/version.ts: Auto-generated: contains the CLI version.
  • templates/: Add folders here for new templates (e.g., templates/react/).

How to Add a New Template

  1. Create a new folder in templates/ (e.g., templates/express/).
  2. Add your starter files (e.g., README.md, package.json, etc.).
  3. Use ${name} in files to auto-replace with the project name.
  4. Scaffold with:
    npx lershi-minimal-app my-app -t express

Development & Deployment

  • Build:
    npm run build
  • Test:
    npm test
  • Publish to npm:
  1. npm run changeset
  2. npm run version
  3. npm run prebuild
  4. git add . && git commit -m "release: version bump and changelog"
  5. git push
  6. npm run publish:prod

Next Steps

  • Add more templates to templates/
  • Add more prompts or features in src/cli.ts
  • Extend logging or validation as needed

Versioning: Keeping the CLI Version in Sync

Why do we generate src/version.ts?

  • Reading package.json at runtime can fail after build/publish, causing errors like:
    Error: ENOENT: no such file or directory, open '.../dist/package.json'
  • Instead, we generate src/version.ts at build time, which exports the version from package.json.
  • The CLI imports this version directly:
    import { version } from './version.js';

Why the .js extension?

  • In ESM (with "type": "module"), Node.js requires explicit file extensions in imports.
  • Using import { version } from './version.js'; ensures the import works after build and publish.

Summary

  • No runtime file reads or path issues.
  • The version is always in sync with package.json.
  • The CLI works reliably with npx, local, and global installs.