Vue Secret Key Generator
Vue Secret Key Generator is a secret key generator for token or other sensitive information hashing purpose
It will add the new secret key into your VUE_APP_SECRET_KEY variable in the .env (dotenv) file.
Or you can just copy and paste the key that showed in your command line into wherever you want.
Installation
Install to your VueJs project
npm install --save @krishnawijaya/vue-secret-key-generator
Usage
- Move to your project directory
cd /your/project/path
- Configure “generate” command
- Open package.json file of your project
- Add generate command to your project
"generate-key": "generate"
- So that your code in the script section looks like this
"scripts": { "your": "another-script", "generate-key": "generate", "your": "others-script" },
- Then save your package.json file
- Generate the secret key
- Generate with default settings:15 digits length and consist of A-Z, a-z, 0-9 without I, O alphabets
Automatically added to your VUE_APP_SECRET_KEY variable in your .env file
generate-key
- Generate with your own settings:Example:
generate-key -- --length 20 --chars "abcdefg12345" --variable "YOUR_CUSTOM_VARIABLE_NAME" --filepath "/your/custom/path"
- Use in other file:If you want to use the new secret key outside the .env file
You can pass the “-m” or “–manual” flag in the command
generate-key -- --manual
Then copy and paste the key wherever you want
- Generate with default settings:15 digits length and consist of A-Z, a-z, 0-9 without I, O alphabets
Show help information
See complete usage info:
generate --help