Uniquenv ·
Uniquenv is a tool for safe environment files.
- Quick: You can use environment variables safely without using any password.
- Unique: Your environment files are unique. Even if your files are stolen, they cannot be used on another computer.
npm install uniquenv
- Create environment file:
const uniquenv = require('uniquenv');
const data = {
host: uniquenv.input('Host: '),
username: uniquenv.input('Username: '),
password: uniquenv.password('Password: ')
};
const file = 'db.uniquenv';
uniquenv.create(file, data);
- Use environment variables:
const uniquenv = require('uniquenv');
const file = 'db.uniquenv';
const db = uniquenv.parse(file);
console.log(
db.host,
db.username,
db.password
);