@berk76/mypwd
v1.1.4
Published
Very simple password manager for my js projects
Readme
MyPwd
Very simple password manager for my js projects.
I often forgot the passwords in my scripts and committed them to the repository. So I created a simple password manager so that it doesn't happen to me anymore.
Usage
Create file mypwd.json with passwords in your $HOME directory. For example C:\Users\jarberan\mypwd.json
{
"mongo-uat": {
"login": "appl",
"password": "hS78#pbTgc#J.CQL",
"server": "myserver-uat.com"
},
"mongo-dev": {
"login": "appl",
"password": "VacK>p3k3~t*c~RX",
"server": "myserver-dev.com",
"note": "Valid until end of month"
}
}Now you can access your secrets from js code and you will never commit secret anymore.
const mypwd = require('@berk76/mypwd');
let login, password, server;
[login, password, server] = mypwd.getValues('mongo-uat', ['login', 'password', 'server']);Keep your passwords safe and encrypt mypwd.json with GPG
You should store your passwords in encrypted file mypwd.json.gpg instead of in plain text file mypwd.json.
- install GPG (if you are using GitBash you probably have gpg already installed)
- create key-pair
gpg --gen-key - encrypt your passwords
gpg --output mypwd.json.gpg --encrypt --recipient [email protected] mypwd.json - try to decrypt it
gpg --decrypt mypwd.json.gpg - finally you can remove plain text file
rm mypwd.jsonand mypwd will usemypwd.json.gpg
Installation
Installation is simple:
npm install @berk76/mypwdContribution
Feel free create issue or pull request.
