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

cs-pack

v1.1.47

Published

Automatic Husky + Gitleaks + SonarQube setup for any JS/TS project

Readme

cs-setup

cs-setup is a CLI that standardizes local DevOps checks for JS/TS repos by installing tools and generating Husky hooks:

  • pre-commit: lint (monorepo-aware) → gitleaks (staged-only) → coverage (best-effort) → SonarQube (optional)
  • pre-push: runs a local CI script (smoke + newman)

This README is written for real-world usage across npm, pnpm, and yarn (including pnpm workspaces/monorepos).


✅ What it creates/updates in your project

After running init / check-hooks, cs-setup may create or update:

  • hooks: /.husky/pre-commit, /.husky/pre-push
  • scripts: /scripts/run-ci-checks.sh
  • newman runner: /tests/run-newman-cloud.mjs (template)
  • gitleaks: /.gitleaksignore and /.tools/gitleaks/
  • sonar: /sonar-project.properties
  • GitHub templates: /.github/ (workflows + scripts)
  • package.json scripts (added if missing): test:smoke, test:newman, test:all
  • package.json prepare: a safe cross-platform prepare script that won’t break installs on Windows if husky isn’t present yet

📦 Install (GitHub repo)

Replace <ORG>/<REPO> with your public repo (example: Creolestudios/DevOps-standards).

npm

npm i -D github:Creolestudios/DevOps-standards#master
npx cs-setup init

yarn (classic v1)

yarn add -D github:Creolestudios/DevOps-standards#master
npx cs-setup init

pnpm (single package repo)

pnpm add -D github:Creolestudios/DevOps-standards#master
pnpm exec cs-setup init

pnpm workspace / monorepo

If you run the command at the workspace root (you have pnpm-workspace.yaml), pnpm requires -w to install at root.

Install at workspace root

pnpm add -Dw github:Creolestudios/DevOps-standards#master
pnpm exec cs-setup init

▶️ Commands

Initialize

npx cs-setup init

pnpm alternative:

pnpm exec cs-setup init

Repair / refresh hooks without full setup

npx cs-setup check-hooks

🧠 How linting works (important for monorepos)

  • If a lint script exists, cs-setup runs it.
  • If this is a pnpm workspace, cs-setup runs lint for every workspace package (serial, no-bail) and prints all outputs.
  • Then it also runs a workspace-root ESLint scan (only if a root ESLint config + eslint binary exists) to ensure “whole codebase” coverage.
  • The commit is blocked only after the complete run finishes, if any errors were found.

⚙️ SonarQube setup

sonar-project.properties is generated. You must fill:

  • sonar.host.url
  • sonar.login (token) — if it stays as REPLACE_WITH_YOUR_TOKEN, Sonar scan is skipped.

🛠️ Troubleshooting (copy/paste)

1) pnpm workspace root warning (ERR_PNPM_ADDING_TO_ROOT)

Install at root explicitly:

pnpm add -Dw github:<ORG>/<REPO>

2) pnpm store mismatch (ERR_PNPM_UNEXPECTED_STORE)

This happens if node_modules was installed with a different pnpm store (often WSL vs Windows).

rm -rf node_modules
pnpm install

3) pnpm virtual store mismatch (ERR_PNPM_VIRTUAL_STORE_DIR_MAX_LENGTH_DIFF)

Recreate node_modules:

rm -rf node_modules
pnpm install

4) GitHub install tries SSH and fails (DNS/SSH blocked)

If pnpm tries git+ssh://[email protected]/... and you get Could not resolve hostname github.com / SSH errors, use HTTPS:

pnpm add -D "git+https://github.com/<ORG>/<REPO>.git#master"

or tarball:

pnpm add -D "https://codeload.github.com/<ORG>/<REPO>/tar.gz/master"

5) Windows: hooks don’t run

Husky hooks are sh scripts. Use Git Bash (recommended) or WSL.

6) TypeScript / ESLint crash (TypeScript too new for @typescript-eslint)

If you see warnings like:

  • SUPPORTED TYPESCRIPT VERSIONS ... YOUR TYPESCRIPT VERSION: 5.9.x and/or ESLint crashes during lint, run:
npx cs-setup check-hooks

cs-setup will auto-upgrade @typescript-eslint/parser and @typescript-eslint/eslint-plugin to a compatible major version.


🔄 Updating cs-setup

# npm
npm i -D github:<ORG>/<REPO>#<branch-or-tag>

# pnpm
pnpm add -D github:<ORG>/<REPO>#<branch-or-tag>

# yarn
yarn add -D github:<ORG>/<REPO>#<branch-or-tag>

npx cs-setup check-hooks