@nogoo9/gitleaks
v8.30.1-post.2
Published
npm wrapper for gitleaks — find secrets in git repos
Maintainers
Readme
@nogoo9/gitleaks
npm wrapper for gitleaks — find secrets in git repos.
Installs the correct gitleaks binary for your platform automatically via npm's
optional dependencies
mechanism (same pattern as esbuild).
No postinstall scripts. No network calls at install time.
Installation
npm install @nogoo9/gitleaks
# or
bun add @nogoo9/gitleaks
# or
pnpm add @nogoo9/gitleaksUsage
CLI
After installation the gitleaks binary is available via npx:
npx gitleaks detect --source .
npx gitleaks protect --staged
npx gitleaks versionOr run it directly if node_modules/.bin is on your PATH:
gitleaks detect --source .Node.js API
import { run, getBinaryPath } from '@nogoo9/gitleaks';
// Get the path to the gitleaks binary
const bin = getBinaryPath();
// Run gitleaks programmatically
const result = await run(['detect', '--source', '.', '--exit-code', '1']);
console.log(result.stdout);
console.log('exit code:', result.exitCode);Platform Support
The correct binary is selected automatically at install time:
| Platform | Architecture | Package |
|---|---|---|
| Linux | x64 | @nogoo9/gitleaks-linux-x64 |
| Linux | x32 | @nogoo9/gitleaks-linux-x32 |
| Linux | arm64 | @nogoo9/gitleaks-linux-arm64 |
| Linux | arm (v7) | @nogoo9/gitleaks-linux-arm |
| macOS | x64 | @nogoo9/gitleaks-darwin-x64 |
| macOS | arm64 (M1/M2/M3) | @nogoo9/gitleaks-darwin-arm64 |
| Windows | x64 | @nogoo9/gitleaks-windows-x64 |
| Windows | x32 | @nogoo9/gitleaks-windows-x32 |
| Windows | arm64 | @nogoo9/gitleaks-windows-arm64 |
Environment Variables
| Variable | Description |
|---|---|
| NOGOO9_GITLEAKS_BIN | Override the path to the gitleaks binary |
Versioning
This package version tracks the upstream gitleaks
release version exactly (e.g. @nogoo9/[email protected] wraps gitleaks v8.30.1).
License
MIT — see LICENSE.
The bundled gitleaks binary is also MIT licensed —
see LICENSES/gitleaks-MIT.txt.
