{"_id":"secure-env","_rev":"3-12238302b88f4ddeae74fc582d715189","name":"secure-env","description":"Use ENVs securely with encryption","dist-tags":{"latest":"1.2.0"},"versions":{"1.0.0":{"name":"secure-env","version":"1.0.0","description":"Use ENVs securely with encryption","main":"dist/es5/lib/index.js","preferGlobal":true,"bin":{"secure-env":"dist/es5/lib/cli.js"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1","prebuild-es5":"rimraf dist/es5","build-es5":"babel ./ --out-dir dist/es5/ --ignore ./node_modules,./.babelrc,./package.json,./package-lock.json,./npm-debug.log,./LICENSE,./README.md --copy-files"},"repository":{"type":"git","url":"git+https://github.com/kunalpanchal/secure-env.git"},"keywords":["dotenv","secure-env","encrypt-env","decrypt-env"],"author":{"name":"kunalpanchal"},"license":"ISC","bugs":{"url":"https://github.com/kunalpanchal/secure-env/issues"},"homepage":"https://github.com/kunalpanchal/secure-env#readme","devDependencies":{"babel-cli":"^6.26.0","babel-preset-es2015":"^6.24.1","rimraf":"^2.6.2"},"dependencies":{"minimist":"^1.2.0"},"gitHead":"2d951089de54ec8e8e019fb71e1020679167f8a7","_id":"secure-env@1.0.0","_npmVersion":"5.4.2","_nodeVersion":"8.2.1","_npmUser":{"name":"kunalpanchal","email":"hello@kunalpanchal.in"},"dist":{"integrity":"sha512-UzFDwa32C1SjHDxI3+I+Z7tC98eD2MBo05ejSYnNiMjYVljdZT/Otx962lCY14pKtSreB8NoyMUAxQnyqexWGQ==","shasum":"c924b20d55dedf1fe79aefc8ca468fc31fe62df3","tarball":"https://registry.npmjs.org/secure-env/-/secure-env-1.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQChW+YikDhx9chlylNtz0339/+oh57VlZXzL8SKSTwVsQIhANPgqLQMtZipsfctLrJ9ADusfn7DRycUg4Ad4V07UcvN"}]},"maintainers":[{"name":"kunalpanchal","email":"hello@kunalpanchal.in"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/secure-env-1.0.0.tgz_1506780314878_0.8930729229468852"},"directories":{}},"1.1.0":{"name":"secure-env","version":"1.1.0","description":"Use ENVs securely with encryption","main":"dist/es5/lib/index.js","preferGlobal":true,"bin":{"secure-env":"dist/es5/lib/cli.js"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1","prebuild-es5":"rimraf dist/es5","build-es5":"babel ./ --out-dir dist/es5/ --ignore ./node_modules,./.babelrc,./package.json,./package-lock.json,./npm-debug.log,./LICENSE,./README.md --copy-files"},"repository":{"type":"git","url":"git+https://github.com/kunalpanchal/secure-env.git"},"keywords":["dotenv","secure-env","encrypt-env","decrypt-env"],"author":{"name":"kunalpanchal"},"license":"ISC","bugs":{"url":"https://github.com/kunalpanchal/secure-env/issues"},"homepage":"https://github.com/kunalpanchal/secure-env#readme","devDependencies":{"babel-cli":"^6.26.0","babel-preset-es2015":"^6.24.1","rimraf":"^2.7.1"},"dependencies":{"minimist":"^1.2.0"},"gitHead":"94c2bd41df516343da99ae43cfd715a2274ffc16","_id":"secure-env@1.1.0","_nodeVersion":"12.1.0","_npmVersion":"6.10.0","dist":{"integrity":"sha512-du/9lYfop4WLnIyd166eYxW5wfN/RvQ0L4sD5LYnPDF2tPcv8j/MocLQvO4fVwJ31KIBf2LsCR0XkgrD/CXr9g==","shasum":"00192b798c90a23949d3de4643d2cde8c96afee6","tarball":"https://registry.npmjs.org/secure-env/-/secure-env-1.1.0.tgz","fileCount":10,"unpackedSize":11994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdnIicCRA9TVsSAnZWagAAzdEP/jOYgyxwovuG3FM1Nrqu\nH10mBwpWUwoehRydKpDYcZmrFwXDU96+FnfR0T2BLTeh9ETTnqtjrzSd1vsr\nY8IKcl2/1yRJ8THW06yiEkZHm43ymxCVqRkzEtO+MKQorJ4xEfiADO6jJ5qE\neQYYKbldrCb+rXvfNfT9riEhKY2Eo7JqZaS17Ngdqg2IkoYIwm4DOqPUPOt8\nfwJa53J5CXSMiobBufIB3YILp0afjkZPS61JJxPNfEGiys/+GBZxTzmP0wwW\nRvo433P2t/I42GiSPOLAtj+Hqwq2YlcxFebVj2r+oe+rfyceHpFWqI8G429C\nAWrR0a1MOYc1RwtNTHHjVimfYLtnJK05WMzu7hVwd6gvAg1errQ+cKwgaXum\nkXUN63LvkUnoxvvaTFWFr5mA7wMcpfZZ0fTAOJE6HnJFjMUmE8eYJ1FmDyF5\nYZr5xnaiDnP70ZswdvJmSLJzKwS68QXPxtCAnq0Rjv+TElCGa5AL+RmBuQjv\n3JcwLKckO7aOBvtBDvCurTIRWoTqPOOHjE9ppYuF/j0e5i3XtEMFU6AAein5\n6cMeQ0EO24MWEVI7Czuk1mivCs91jysGPYm2tUk4A+f2YuOvg7qquVW+GTd8\nRhxSEL1mxzFC6yofQ9kri8iHLDMfIprFKR2Dk6Pz6tiFlylfrU8zve6ubzln\nXz5u\r\n=v5KO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDrjG3Q1HGr6CXK6iY0mJ77xFDL3x9tp3wB9leKApPGiQIhAPXsJ6LHK27IZAJ01dviKV1oIgud6AXc+aXJak/7BqXk"}]},"maintainers":[{"name":"kunalpanchal","email":"hello@kunalpanchal.in"}],"_npmUser":{"name":"kunalpanchal","email":"hello@kunalpanchal.in"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/secure-env_1.1.0_1570539675371_0.8215596581109454"},"_hasShrinkwrap":false},"1.2.0":{"name":"secure-env","version":"1.2.0","description":"Use ENVs securely with encryption","main":"dist/es5/lib/index.js","preferGlobal":true,"bin":{"secure-env":"dist/es5/lib/cli.js"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1","prebuild":"rimraf dist/es5","build":"babel ./ --out-dir dist/es5/ --ignore ./node_modules,./.babelrc,./package.json,./package-lock.json,./npm-debug.log,./LICENSE,./README.md --copy-files"},"repository":{"type":"git","url":"git+https://github.com/kunalpanchal/secure-env.git"},"keywords":["dotenv","secure-env","encrypt-env","decrypt-env"],"author":{"name":"kunalpanchal"},"license":"ISC","bugs":{"url":"https://github.com/kunalpanchal/secure-env/issues"},"homepage":"https://github.com/kunalpanchal/secure-env#readme","devDependencies":{"@babel/cli":"^7.6.2","@babel/core":"^7.6.2","@babel/preset-env":"^7.6.2","rimraf":"^3.0.0"},"dependencies":{"minimist":"^1.2.0"},"gitHead":"ec1df6c30c84cfa4b246d118b35e5fe63b1fda46","_id":"secure-env@1.2.0","_nodeVersion":"12.1.0","_npmVersion":"6.10.0","dist":{"integrity":"sha512-BNi4AlHP6sMZv3ybFWD5/eieFGcqt93VRLzceUdt3+PftgVnxN7eRY7POtFm5PQqaQn5aoRoxG3A4HH9kUmeKw==","shasum":"a2ae5937d3b6edc87626f6a3289941b40ae73052","tarball":"https://registry.npmjs.org/secure-env/-/secure-env-1.2.0.tgz","fileCount":4515,"unpackedSize":12924269,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdoNwSCRA9TVsSAnZWagAALUsP/A/JzbQ279FmuNR+Llfj\nmXvGyLnrmz4YdHuSDwsNz6bzPKSVP4268kkbIUITwoDbrk6nFJuCWUgUrvL+\nKomitctePPW2wCTeWOLGjTTx/MpRh/yXBfMMKycwIaTLIkmfyVep9jG+Ga88\nPcmJH/qknymJiP2agei+MFuUrrjWg9cXOeQB+IaJ+W6VxyyQ7MPb74jE0OT8\nIJvdpKmyjMreQvkwcOAwVgimz/cToqsrmCwuVO1lKcnwgZ1d99nw+sfezm2s\nbCgNhpZN9VCY2gP9/qN1sZyfCssujR/yzsEJ8QwPmOyUurqg4MvcC10Cb7iD\nDws1lmtHtcFnZE+DP+uYH+1TW8C4MzhxTtO+mqdGprBUYyFJ76Qgqw0EVK+H\nNMAL2+E9PLQ5+rWwlVQhSpTR2KvRe4aFPpuowghaAXuTecQIHEfWoAV6LwTN\nfV/a85xSjJy31rEiKwtZoA2EWx6OclZLPbNQozL3X4ezJbnWlYBupn7GNQ5z\nJJQZSHM+6sLsTu+W3tv9Ss6iSsvQY0+5nyK1Olhk08eIt//i9OrnInPV7kBN\n1HeHf+rNUmkvrnRncgXcmmxnlG8iik9qQCr064WkMsTr7xiXCR8sXbnZ6m5B\n0hoOt0+Mkt37222qTvHxJD4T44GSLRZZAh/crsaBxKx0ffYLA6vY4tyjyDJP\n197l\r\n=qJ6I\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDL23sU/DzFRo9Gx7HyMtG5RvTgRIXOAiqd6QH1LQiWSgIgN4ARBzsQMdxmcEhqfzjPgaPTrZwb18qewOQZvcsWR/Q="}]},"maintainers":[{"name":"kunalpanchal","email":"hello@kunalpanchal.in"}],"_npmUser":{"name":"kunalpanchal","email":"hello@kunalpanchal.in"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/secure-env_1.2.0_1570823185945_0.4549133941650947"},"_hasShrinkwrap":false}},"readme":"[![npm version](https://badge.fury.io/js/secure-env.svg)](https://badge.fury.io/js/secure-env)\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://GitHub.com/kunalpanchal/secure-env/graphs/commit-activity)\n[![GitHub license](https://img.shields.io/github/license/Naereen/StrapDown.js.svg)](https://github.com/kunalpanchal/secure-env/blob/master/LICENSE)\n[![GitHub release](https://img.shields.io/github/release/Naereen/StrapDown.js.svg)](https://gitHub.com/kunalpanchal/secure-env/releases/)\n[![Github all releases](https://img.shields.io/github/downloads/Naereen/StrapDown.js/total.svg)](https://gitHub.com/kunalpanchal/secure-env/releases/)\n[![GitHub stars](https://img.shields.io/github/stars/Naereen/StrapDown.js.svg?style=social&label=Star&maxAge=2592000)](https://gitHub.com/kunalpanchal/secure-env/stargazers/)\n\n\n# secure-env\n\nSecure-env is a module that loads environment variables from a `.env.enc` file.A encryption tool that would helps you prevent attacks from [npm-malicious-packages][npm-malicious-packages].\n\n## Usage\n\nCreate a `.env` file in the root directory of your project. Add\nenvironment-specific variables on new lines in the form of `NAME=VALUE`.\nFor example:\n\n```dosini\nDB_HOST=localhost:27017\nDB_USER=scott\nDB_PASS=tiger\n```\n\n### Encrypt .env\n\n```bash\n$ npm install -g secure-env\n$ secure-env .env -s mySecretPassword\n```\nAlternatively if you want this installed locally run the command as follows:\n\n```bash\n$ ./node_modules/secure-env/dist/es5/lib/cli.js .env -s mySecretPassword\n```\n\nIf you are running NPM > v5.2. You can use `npx`:\n\n```bash\n$ npx secure-env .env -s mySecretPassword\n```\n\nA new encrypted file `.env.enc` will be created in your project root directory.You can delete the `.env` file after this,to prevent stealing. \n\n \n### Decrypt .env.enc\n \nAs early as possible in your application, require and configure dotenv.\n\n```javascript\nlet secureEnv = require('secure-env');\nglobal.env = secureEnv({secret:'mySecretPassword'});\n\n```\n\nThat's it.\n\n`global.env` now has the keys and values you defined in your `.env` file.\n\n```javascript\nvar db = require('db')\ndb.connect({\n  host: global.env.DB_HOST,\n  username: global.env.DB_USER,\n  password: global.env.DB_PASS\n})\n```\n\n## Options\n\n### Encryption\n\n```bash\n$ secure-env --option <VALUE> <file-path-which-is-to-be-encrypted>\n```\n\n| Option | What does it do | Defaults |\n| ------ | ------ | ------ |\n| --secret <secretKey> | Specify the secret Key which would be later used to decrypt the file. | `mySecret` |\n| --out <file-path> | The encrypted file path that would be created. | `env.enc` |\n| --algo <algoName> | The encryption algorithm that is to be used to encrypt the env file. | `aes256` |\n| --decrypt | prints the decrypted text to stdout\n\n\n### Decryption\n\n#### Path\n\nDefault: `.env`\n\nYou can specify a custom path if your file containing environment variables is\nnamed or located differently.\n\n```js\nrequire('secure-env')({path:'/custom/path/to/your/env/vars'});\n```\n\n#### Decryption Algorithm\n\nDefault: `aes256`\n\nYou may specify the encryption algorithm for your file containing environment variables\nusing this option.\n\n```js\nrequire('secure-env')({enc_algo:'aes256'});\n```\n\n#### Secret\n\nDefault: `mySecret`\n\nSpecify the secret Key which was used during encryption of raw file.Having a salt-hashed secret key is recommended.\n\n```js\nrequire('secure-env')({secret:'mySecretPassword'});\n```\n\n## Parse rules \n\nRefer https://github.com/motdotla/dotenv/blob/master/README.md#parse\n\nThe parsing engine currently supports the following rules:\n\n- `BASIC=basic` becomes `{BASIC: 'basic'}`\n- empty lines are skipped\n- lines beginning with `#` are treated as comments\n- empty values become empty strings (`EMPTY=` becomes `{EMPTY: ''}`)\n- single and double quoted values are escaped (`SINGLE_QUOTE='quoted'` becomes `{SINGLE_QUOTE: \"quoted\"}`)\n- new lines are expanded if in double quotes (`MULTILINE=\"new\\nline\"` becomes\n\n```\n{MULTILINE: 'new\nline'}\n```\n- inner quotes are maintained (think JSON) (`JSON={\"foo\": \"bar\"}` becomes `{JSON:\"{\\\"foo\\\": \\\"bar\\\"}\"`)\n- whitespace is removed from both ends of the value (see more on [`trim`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim)) (`FOO=\"  some value  \"` becomes `{FOO: 'some value'}`)\nG.md)\n\n## License\n\nSee [LICENSE](LICENSE)\n\n## Dependencies\n\nSource-env uses these open source projects to work properly:\n\n* [Minimist][minimist] - Argument parser without all the fanciful decoration.\n\n## Contributors\n\n<a href=\"https://github.com/kunalpanchal/secure-env/graphs/contributors\">\n  <img src=\"https://contributors-img.firebaseapp.com/image?repo=kunalpanchal/secure-env\" />\n</a>\n\n\n## Acknowledgements\n\nSource-env is inspired from and also uses code references from these open source projects:\n\n* [Dotenv][dotenv]\n\n[npm-malicious-packages]: <https://iamakulov.com/notes/npm-malicious-packages/>\n[minimist]: <https://www.npmjs.com/package/minimist>\n[dotenv]: <https://github.com/motdotla/dotenv/>\n","maintainers":[{"name":"kunalpanchal","email":"hello@kunalpanchal.in"}],"time":{"modified":"2022-05-17T09:24:58.166Z","created":"2017-09-30T14:05:15.002Z","1.0.0":"2017-09-30T14:05:15.002Z","1.1.0":"2019-10-08T13:01:15.494Z","1.2.0":"2019-10-11T19:46:26.261Z"},"homepage":"https://github.com/kunalpanchal/secure-env#readme","keywords":["dotenv","secure-env","encrypt-env","decrypt-env"],"repository":{"type":"git","url":"git+https://github.com/kunalpanchal/secure-env.git"},"author":{"name":"kunalpanchal"},"bugs":{"url":"https://github.com/kunalpanchal/secure-env/issues"},"license":"ISC","readmeFilename":"README.md"}