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

create-next-saas-base

v0.1.1

Published

Scaffold a production-ready Next.js SaaS starter — Auth.js, Stripe billing, RBAC and metered quotas.

Readme

create-next-saas-base

Scaffold a production-ready Next.js SaaS starter — Auth.js credentials auth with 2FA, Stripe billing, static RBAC, and a metered quota engine.

npx create-next-saas-base my-app
# or
npm create next-saas-base my-app
Options
  --skip-install   Do not run the package install step
  --skip-git       Do not initialise a git repository

The CLI copies the template, names the project after its directory, generates NEXTAUTH_SECRET, SECRET_KEY, JWT_SECRET_KEY_FOR_STRIPE_TOKEN and CRON_SECRET into a fresh .env.local, initialises git, and installs dependencies. MONGODB_URI and STRIPE_SECRET_KEY are left blank — fill those in, then npm run seed.


Maintaining this package

The two-copies problem

template/ is a generated mirror of the repository root. Never edit it by hand — edit the repo, then:

npm run sync

prepublishOnly runs the sync and a tarball check automatically, so a publish cannot ship a stale or unsafe copy. template/ is gitignored; it exists only between a sync and a publish.

Publishing

npm version patch      # or minor / major
npm publish            # runs sync + check-tarball first

Three things npm does that will catch you out

A bin path written as "./bin/index.js" gets rewritten — or dropped. npm normalises package.json on publish and only warns:

npm warn publish "bin[create-next-saas-base]" script name was cleaned
npm warn publish "bin[create-next-saas-base]" script name bin/index.js was invalid and removed

The second form, on newer npm, means the published package has no bin at allnpx create-next-saas-base silently does nothing. Write bin paths without the leading ./. scripts/check-tarball.js fails the publish if one creeps back in.

.gitignore and .npmrc are silently dropped from published tarballs. Not a warning — the files are simply absent. So the sync ships them as gitignore and npmrc, and bin/index.js restores the dot when it copies. If you add another dotfile that npm strips, add it to DOTFILE_RENAMES in both files. Verify with:

npm pack --dry-run

.env files are published quite happily. They are not on npm's excluded list, so an .env.local sitting in the repo would ship to the public registry along with whatever live keys it holds. scripts/sync-template.js excludes them and aborts if one slips through; scripts/check-tarball.js re-checks the actual tarball before publish. Keep both — a published secret is a rotated secret, because a tarball cannot be unpublished after 72 hours.

Files

| Path | Purpose | | --- | --- | | bin/index.js | The CLI. No dependencies, by design. | | scripts/sync-template.js | Mirrors the repo into template/, applying exclusions and dotfile renames. | | scripts/check-tarball.js | Pre-publish gate: asks npm what it is about to ship and refuses on secrets or missing files. | | template/ | Generated. Gitignored. Do not edit. |