Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More β†’
Socket
Sign inDemoInstall
Socket

dotenv

Package Overview
Dependencies
Maintainers
3
Versions
86
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dotenv - npm Package Compare versions

Comparing version 16.1.4 to 16.2.0

9

CHANGELOG.md

@@ -5,4 +5,11 @@ # Changelog

## [Unreleased](https://github.com/motdotla/dotenv/compare/v16.1.0...master)
## [Unreleased](https://github.com/motdotla/dotenv/compare/v16.2.0...master)
## [16.2.0](https://github.com/motdotla/dotenv/compare/v16.1.4...v16.2.0) (2023-06-15)
### Added
- Optionally write to your own target object rather than `process.env`. Defaults to `process.env`. [#753](https://github.com/motdotla/dotenv/pull/753)
- Add import type URL to types file [#751](https://github.com/motdotla/dotenv/pull/751)
## [16.1.4](https://github.com/motdotla/dotenv/compare/v16.1.3...v16.1.4) (2023-06-04)

@@ -9,0 +16,0 @@

// TypeScript Version: 3.0
/// <reference types="node" />
import type { URL } from 'node:url';

@@ -4,0 +5,0 @@ export interface DotenvParseOutput {

@@ -165,4 +165,9 @@ const fs = require('fs')

DotenvModule.populate(process.env, parsed, options)
let processEnv = process.env
if (options && options.processEnv != null) {
processEnv = options.processEnv
}
DotenvModule.populate(processEnv, parsed, options)
return { parsed }

@@ -189,4 +194,9 @@ }

DotenvModule.populate(process.env, parsed, options)
let processEnv = process.env
if (options && options.processEnv != null) {
processEnv = options.processEnv
}
DotenvModule.populate(processEnv, parsed, options)
return { parsed }

@@ -193,0 +203,0 @@ } catch (e) {

2

package.json
{
"name": "dotenv",
"version": "16.1.4",
"version": "16.2.0",
"description": "Loads environment variables from .env file",

@@ -5,0 +5,0 @@ "main": "lib/main.js",

@@ -286,3 +286,3 @@ <div align="center">

##### Path
##### path

@@ -297,3 +297,3 @@ Default: `path.resolve(process.cwd(), '.env')`

##### Encoding
##### encoding

@@ -308,3 +308,3 @@ Default: `utf8`

##### Debug
##### debug

@@ -319,3 +319,3 @@ Default: `false`

##### Override
##### override

@@ -330,2 +330,16 @@ Default: `false`

##### processEnv
Default: `process.env`
Specify an object to write your secrets to. Defaults to `process.env` environment variables.
```js
const myObject = {}
require('dotenv').config({ processEnv: myObject })
console.log(myObject) // values from .env or .env.vault live here now.
console.log(process.env) // this was not changed or written to
```
### Parse

@@ -346,3 +360,3 @@

##### Debug
##### debug

@@ -388,3 +402,3 @@ Default: `false`

#### Options
#### options

@@ -397,3 +411,3 @@ ##### Debug

##### Override
##### override

@@ -404,2 +418,18 @@ Default: `false`

### Decrypt
The engine which decrypts the ciphertext contents of your .env.vault file is available for use. It accepts a ciphertext and a decryption key. It uses AES-256-GCM encryption.
For example, decrypting a simple ciphertext:
```js
const dotenv = require('dotenv')
const ciphertext = 's7NYXa809k/bVSPwIAmJhPJmEGTtU0hG58hOZy7I0ix6y5HP8LsHBsZCYC/gw5DDFy5DgOcyd18R'
const decryptionKey = 'ddcaa26504cd70a6fef9801901c3981538563a1767c297cb8416e8a38c62fe00'
const decrypted = dotenv.decrypt(ciphertext, decryptionKey)
console.log(decrypted) // # development@v6\nALPHA="zeta"
```
## ❓ FAQ

@@ -406,0 +436,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚑️ by Socket Inc