{"id":15653828,"url":"https://github.com/dhaiwat10/priv-key-precommit","last_synced_at":"2025-04-30T22:06:55.063Z","repository":{"id":40396449,"uuid":"489563315","full_name":"Dhaiwat10/priv-key-precommit","owner":"Dhaiwat10","description":"A simple precommit hook that checks for the presence of an Ethereum private key in your codebase","archived":false,"fork":false,"pushed_at":"2022-05-11T04:52:20.000Z","size":133,"stargazers_count":28,"open_issues_count":3,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-12-26T19:03:52.360Z","etag":null,"topics":["commit","ethereum","husky","key","precommit","priv","private","protection"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/priv-key-precommit","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Dhaiwat10.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-05-07T04:02:33.000Z","updated_at":"2024-05-20T11:11:27.000Z","dependencies_parsed_at":"2022-08-09T19:11:00.282Z","dependency_job_id":null,"html_url":"https://github.com/Dhaiwat10/priv-key-precommit","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dhaiwat10%2Fpriv-key-precommit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dhaiwat10%2Fpriv-key-precommit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dhaiwat10%2Fpriv-key-precommit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dhaiwat10%2Fpriv-key-precommit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Dhaiwat10","download_url":"https://codeload.github.com/Dhaiwat10/priv-key-precommit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232548606,"owners_count":18540145,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["commit","ethereum","husky","key","precommit","priv","private","protection"],"created_at":"2024-10-03T12:47:13.530Z","updated_at":"2025-01-05T04:55:46.264Z","avatar_url":"https://github.com/Dhaiwat10.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# priv-key-precommit\n\nA simple precommit hook that checks for the presence of an Ethereum private key in your codebase.\n\n## Usage\n\n1. Install the package\n\n```bash\nyarn add -D priv-key-precommit\n```\n\n2. Create a script in your `package.json`\n\n```json\n\"scripts\": {\n  \"priv-key-check\": \"priv-key-precommit\"\n}\n```\n\n3. Install husky (or a similar pre-commit hook manager)\n\n```bash\nnpx husky-init \u0026\u0026 yarn\n```\n\n4. Edit the contents of `.husky/pre-commit`\n\n```sh\n#!/bin/sh\n. \"$(dirname \"$0\")/_/husky.sh\"\n\nnpm run priv-key-check\n```\n\n5. Try commiting your code. It won't let you commit your code if it finds a private key in your codebase.\n\n```bash\n❯ git commit -m 'test'\n\n\u003e priv:check\n\u003e priv-key-precommit\n\n🚨 Found 1 instance(s) of private keys. Aborting commit.\n=\u003e .env.example\nhusky - pre-commit hook exited with code 1 (error)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhaiwat10%2Fpriv-key-precommit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdhaiwat10%2Fpriv-key-precommit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhaiwat10%2Fpriv-key-precommit/lists"}