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

@b12k/gitleaks

v8.30.1-v.24

Published

The missing NPM wrapper for Gitleaks

Readme

The missing npm wrapper for Gitleaks

Gitleaks - is a fast, lightweight secret scanner for git repositories.

This library is just a thin wrapper which automatically downloads the correct gitleaks binary for your platform on install and exposes it as a CLI command.

Installation

Typically installed as a dev dependency:

Local (project)

npm install --save-dev @b12k/gitleaks

Recent npm versions require approving dependency install scripts. Approve this package so its postinstall script can download the gitleaks binary:

npm approve-scripts @b12k/gitleaks
pnpm add -D --allow-build=@b12k/gitleaks @b12k/gitleaks

pnpm 11 requires the --allow-build flag so this package's postinstall script can download the gitleaks binary.

yarn add --dev @b12k/gitleaks

Global

npm install -g --allow-scripts=@b12k/gitleaks @b12k/gitleaks

Global npm installs cannot use npm approve-scripts; use --allow-scripts instead.

pnpm add -g --allow-build=@b12k/gitleaks @b12k/gitleaks

pnpm 11 requires the --allow-build flag during global install as well.

yarn global add @b12k/gitleaks

The postinstall script downloads the gitleaks binary for your platform from the official GitHub release.

If you already installed with npm or pnpm and the build was blocked, approve and rebuild it:

npm approve-scripts @b12k/gitleaks
npm rebuild @b12k/gitleaks
pnpm approve-builds @b12k/gitleaks
pnpm rebuild @b12k/gitleaks

Usage

See the gitleaks documentation for the full list of commands and flags.

Local install

npx gitleaks <command>
pnpm exec gitleaks <command>
yarn gitleaks <command>

Global install

gitleaks <command>

package.json script

{ "scripts": { "secrets": "gitleaks <command>" } }

Troubleshooting

If the binary fails to install, re-run with --foreground-scripts to see the postinstall output:

npm install --save-dev @b12k/gitleaks --foreground-scripts
pnpm add -D --allow-build=@b12k/gitleaks @b12k/gitleaks --foreground-scripts
yarn add --dev @b12k/gitleaks --foreground-scripts

Supported platforms

  • Linux — x64, arm64
  • macOS — x64, arm64
  • Windows — x64, arm64

Version

The npm package version mirrors the gitleaks release version.

To install a different gitleaks release, define it in .gitleaks-version as v1.2.3 or 1.2.3 before installing the package.

If you add or change .gitleaks-version after installing, run:

gitleaks-install