Uniquenv ·
![npm version](https://camo.githubusercontent.com/9b33f253eb1c389ad196feb8b398d00d23fad5de7391fb9bb1f951fd405b62bd/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f762f72656163742e7376673f7374796c653d666c6174)
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
);