Comparing version 16.4.1 to 16.4.2
@@ -5,4 +5,10 @@ # Changelog | ||
## [Unreleased](https://github.com/motdotla/dotenv/compare/v16.4.1...master) | ||
## [Unreleased](https://github.com/motdotla/dotenv/compare/v16.4.2...master) | ||
## [16.4.2](https://github.com/motdotla/dotenv/compare/v16.4.1...v16.4.2) (2024-02-10) | ||
### Changed | ||
- Changed funding link in package.json to [`dotenvx.com`](https://dotenvx.com) | ||
## [16.4.1](https://github.com/motdotla/dotenv/compare/v16.4.0...v16.4.1) (2024-01-24) | ||
@@ -9,0 +15,0 @@ |
@@ -12,3 +12,3 @@ // TypeScript Version: 3.0 | ||
* | ||
* See https://docs.dotenv.org | ||
* See https://dotenvx.com/docs | ||
* | ||
@@ -75,3 +75,3 @@ * @param src - contents to be parsed. example: `'DB_HOST=localhost'` | ||
* | ||
* example: `require('dotenv').config({ DOTENV_KEY: 'dotenv://:key_1234β¦@dotenv.org/vault/.env.vault?environment=production' })` | ||
* example: `require('dotenv').config({ DOTENV_KEY: 'dotenv://:key_1234β¦@dotenvx.com/vault/.env.vault?environment=production' })` | ||
*/ | ||
@@ -113,3 +113,3 @@ DOTENV_KEY?: string; | ||
* | ||
* See https://docs.dotenv.org | ||
* See https://dotenvx.com/docs | ||
* | ||
@@ -125,3 +125,3 @@ * @param options - additional options. example: `{ path: './custom/path', encoding: 'latin1', debug: true, override: false }` | ||
* | ||
* See https://docs.dotenv.org | ||
* See https://dotenvx.com/docs | ||
* | ||
@@ -137,3 +137,3 @@ * @param options - additional options. example: `{ path: './custom/path', encoding: 'latin1', debug: true, override: false }` | ||
* | ||
* See https://docs.dotenv.org | ||
* See https://dotenvx.com/docs | ||
* | ||
@@ -151,3 +151,3 @@ * @param processEnv - the target JSON object. in most cases use process.env but you can also pass your own JSON object | ||
* | ||
* See https://docs.dotenv.org | ||
* See https://dotenvx.com/docs | ||
* | ||
@@ -154,0 +154,0 @@ * @param encrypted - the encrypted ciphertext string |
@@ -62,3 +62,3 @@ const fs = require('fs') | ||
// handle scenario for comma separated keys - for use with key rotation | ||
// example: DOTENV_KEY="dotenv://:key_1234@dotenv.org/vault/.env.vault?environment=prod,dotenv://:key_7890@dotenv.org/vault/.env.vault?environment=prod" | ||
// example: DOTENV_KEY="dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=prod,dotenv://:key_7890@dotenvx.com/vault/.env.vault?environment=prod" | ||
const keys = _dotenvKey(options).split(',') | ||
@@ -127,3 +127,3 @@ const length = keys.length | ||
if (error.code === 'ERR_INVALID_URL') { | ||
const err = new Error('INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenv.org/vault/.env.vault?environment=development') | ||
const err = new Error('INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development') | ||
err.code = 'INVALID_DOTENV_KEY' | ||
@@ -130,0 +130,0 @@ throw err |
{ | ||
"name": "dotenv", | ||
"version": "16.4.1", | ||
"version": "16.4.2", | ||
"description": "Loads environment variables from .env file", | ||
@@ -34,3 +34,3 @@ "main": "lib/main.js", | ||
}, | ||
"funding": "https://github.com/motdotla/dotenv?sponsor=1", | ||
"funding": "https://dotenvx.com", | ||
"keywords": [ | ||
@@ -37,0 +37,0 @@ "dotenv", |
<div align="center"> | ||
π announcing <a href="https://github.com/dotenvx/dotenvx">dotenvx</a>. *run anywhere, multi-environment, encrypted envs*. | ||
π announcing <a href="https://github.com/dotenvx/dotenvx">dotenvx</a>. <em>run anywhere, multi-environment, encrypted envs</em>. | ||
</div> | ||
--- | ||
| ||
@@ -7,0 +7,0 @@ <div align="center"> |
@@ -5,3 +5,3 @@ <div align="center"> | ||
--- | ||
| ||
@@ -58,3 +58,2 @@ <div align="center"> | ||
[![LICENSE](https://img.shields.io/github/license/motdotla/dotenv.svg)](LICENSE) | ||
[![dotenv-vault](https://badge.dotenv.org/works-with.svg?r=1)](https://www.dotenv.org/r/github.com/dotenv-org/dotenv-vault?r=1) | ||
@@ -161,2 +160,6 @@ * [π± Install](#-install) | ||
> Note: Consider using [`dotenvx`](https://github.com/dotenvx/dotenvx) instead of preloading. I am now doing (and recommending) so. | ||
> | ||
> It serves the same purpose (you do not need to require and load dotenv), adds better debugging, and works with ANY language, framework, or platform. β [motdotla](https://github.com/motdotla) | ||
You can use the `--require` (`-r`) [command line option](https://nodejs.org/api/cli.html#-r---require-module) to preload dotenv. By doing this, you do not need to require and load dotenv in your application code. | ||
@@ -250,2 +253,27 @@ | ||
Use [dotenvx](https://github.com/dotenvx/dotenvx) or [dotenv-vault](https://github.com/dotenv-org/dotenv-vault). | ||
### dotenvx | ||
Encrypt your secrets to a `.env.vault` file and load from it (recommended for production and ci). | ||
```bash | ||
$ echo "HELLO=World" > .env | ||
$ echo "HELLO=production" > .env.production | ||
$ echo "console.log('Hello ' + process.env.HELLO)" > index.js | ||
$ dotenvx encrypt | ||
[dotenvx][info] encrypted to .env.vault (.env,.env.production) | ||
[dotenvx][info] keys added to .env.keys (DOTENV_KEY_PRODUCTION,DOTENV_KEY_PRODUCTION) | ||
$ DOTENV_KEY='<dotenv_key_production>' dotenvx run -- node index.js | ||
[dotenvx][info] loading env (1) from encrypted .env.vault | ||
Hello production | ||
^ :-] | ||
``` | ||
[learn more](https://github.com/dotenvx/dotenvx?tab=readme-ov-file#encryption) | ||
### dotenv-vault | ||
*Note: Requires dotenv >= 16.1.0* | ||
@@ -269,3 +297,3 @@ | ||
# heroku example | ||
heroku config:set DOTENV_KEY=dotenv://:key_1234β¦@dotenv.org/vault/.env.vault?environment=production | ||
heroku config:set DOTENV_KEY=dotenv://:key_1234β¦@dotenvx.com/vault/.env.vault?environment=production | ||
``` | ||
@@ -397,3 +425,3 @@ | ||
```js | ||
require('dotenv').config({ DOTENV_KEY: 'dotenv://:key_1234β¦@dotenv.org/vault/.env.vault?environment=production' }) | ||
require('dotenv').config({ DOTENV_KEY: 'dotenv://:key_1234β¦@dotenvx.com/vault/.env.vault?environment=production' }) | ||
``` | ||
@@ -400,0 +428,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
77186
726