UNPKG
env-cipher
Version:
latest (0.2.1)
0.2.1
0.2.0
0.1.3
0.1.2
0.1.1
0.1.0
A module to encrypt and decrypt ENV variables
github.com/ralfbecher/env-cipher
ralfbecher/env-cipher
env-cipher
/
test
/
test.js
11 lines
(8 loc)
•
284 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
const
run =
require
(
'../lib/index'
);
// encrypt values to .env-cipher
run.
envCipher
();
// load .env-cipher into process.env
require
(
'dotenv'
).
config
({
path
:
'.env-cipher'
})
// decrypt values from process.env with suffix
const
decrypted = run.
envDecipher
();
console
.
log
(decrypted);