Socket
Book a DemoInstallSign in
Socket

priv-key-precommit

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

priv-key-precommit

A simple precommit hook that checks for the presence of an Ethereum private key in your codebase.

0.5.0
latest
Source
npmnpm
Version published
Weekly downloads
44
76%
Maintainers
1
Weekly downloads
 
Created
Source

priv-key-precommit

A simple precommit hook that checks for the presence of an Ethereum private key in your codebase.

Usage

  • Install the package
yarn add -D priv-key-precommit
  • Create a script in your package.json
"scripts": {
  "priv-key-check": "priv-key-precommit"
}
  • Install husky (or a similar pre-commit hook manager)
npx husky-init && yarn
  • Edit the contents of .husky/pre-commit
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run priv-key-check
  • Try commiting your code. It won't let you commit your code if it finds a private key in your codebase.
❯ git commit -m 'test'

> priv:check
> priv-key-precommit

🚨 Found 1 instance(s) of private keys. Aborting commit.
=> .env.example
husky - pre-commit hook exited with code 1 (error)

FAQs

Package last updated on 11 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.