1.0.2 • Published 5 years ago

discord-police v1.0.2

Weekly downloads
1
License
ISC
Repository
-
Last release
5 years ago

Discord Police

Check your files for leaked discord bot tokens before you commit your files.

Install

npm install --save-dev discord-police husky

Using as a pre-commit hook

Add the following husky property to your package.json

{
  "name": "my-discord-bot",
  "version": "1.0.0",
  "devDependencies": {
    "discord-police": "1.0.2",
    "husky": "^3.0.0"
  },
  "husky": {
    "hooks": {
      "pre-commit": "discord-police --dir src"
    }
  }
}

The next time you commit your files to git, they will automatically be checked for tokens.

[ Discord Police 🚨 ] A discord bot token was found in src/index.js on line 7

CLI

discord-police --dir src --ignore .env,secret_files

Args

--dir Directory to search from


Discord police automatically ignores everything inside your .gitignore file. This should already cover almost every single case (since you should be ignoring credential files), but if you really need to...

--ignore List of directories/files to ignore separated by commas Default: null

Files and folders ignored by default: node_modules, dist, .git, output