@dotenvx/dotenvx 2.11.3 → 2.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,7 +2,23 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
- [Unreleased](https://github.com/dotenvx/dotenvx/compare/v2.11.3...main)
5
+ [Unreleased](https://github.com/dotenvx/dotenvx/compare/v2.13.0...main)
6
+
7
+ ## [2.13.0](https://github.com/dotenvx/dotenvx/compare/v2.12.0...v2.13.0) (2026-07-16)
8
+
9
+ ### Added
10
+
11
+ * Add `get --eval-export` flag ([#904](https://github.com/dotenvx/dotenvx/pull/904))
12
+
13
+ ### Changed
14
+
15
+ * Make `get --eval` posix safe ([#904](https://github.com/dotenvx/dotenvx/pull/904))
16
+
17
+ ## [2.12.0](https://github.com/dotenvx/dotenvx/compare/v2.11.3...v2.12.0) (2026-07-16)
18
+
19
+ ### Changed
20
+
21
+ * Small Breaking: Single quoted `'Let\'s go'` now correctly escapes to `Let's go` ([#903](https://github.com/dotenvx/dotenvx/pull/903))
6
22
 
7
23
  ## [2.11.3](https://github.com/dotenvx/dotenvx/compare/v2.11.2...v2.11.3) (2026-07-16)
8
24
 
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.11.3",
2
+ "version": "2.13.0",
3
3
  "name": "@dotenvx/dotenvx",
4
4
  "description": "a secure dotenv–from the creator of `dotenv`",
5
5
  "author": "@motdotla",
@@ -43,7 +43,7 @@
43
43
  },
44
44
  "funding": "https://dotenvx.com",
45
45
  "dependencies": {
46
- "@dotenvx/primitives": "^1.10.0",
46
+ "@dotenvx/primitives": "^2.0.0",
47
47
  "@dotenvx/tooling": "^1.0.2",
48
48
  "yocto-spinner": "^1.2.1"
49
49
  },
@@ -76,10 +76,11 @@ async function get (key) {
76
76
  console.log(single)
77
77
  }
78
78
  } else {
79
- if (options.format === 'eval') {
79
+ if (options.format === 'eval' || options.format === 'eval-export') {
80
+ const prefix = options.format === 'eval-export' ? 'export ' : ''
80
81
  let inline = ''
81
82
  for (const [key, value] of Object.entries(parsed)) {
82
- inline += `${key}=${escape(value)}\n`
83
+ inline += `${prefix}${key}=${escape(value)}\n`
83
84
  }
84
85
  inline = inline.trim()
85
86
 
@@ -94,7 +94,7 @@ program.command('get')
94
94
  .option('--mask [characters]', 'mask values, optionally setting visible characters')
95
95
  .option('-pp, --pretty-print', 'pretty print output')
96
96
  .option('--pp', 'pretty print output (alias)')
97
- .option('--format <type>', 'format of the output (json, shell, colon, eval)', 'json')
97
+ .option('--format <type>', 'format of the output (json, shell, colon, eval, eval-export)', 'json')
98
98
  .option('--no-armor', 'disable Dotenvx Armor features')
99
99
  .option('--no-native', 'disable OS secret store features')
100
100
  .action(function (...args) {
@@ -1,5 +1,6 @@
1
1
  function escape (value) {
2
- return JSON.stringify(value)
2
+ const quote = String.fromCharCode(39)
3
+ return quote + value.replaceAll(quote, quote + '\\' + quote + quote) + quote
3
4
  }
4
5
 
5
6
  module.exports = escape
package/src/lib/main.js CHANGED
@@ -20,6 +20,7 @@ const setTransform = require('./transforms/set')
20
20
  const buildEnvs = require('./helpers/buildEnvs')
21
21
  const buildConfigEnvs = require('./helpers/buildConfigEnvs')
22
22
  const { determine } = require('./helpers/envResolution')
23
+ const escape = require('./helpers/escape')
23
24
  const fsx = require('./helpers/fsx')
24
25
  const decryptKeyValue = require('./helpers/cryptography/decryptKeyValue')
25
26
  const Errors = require('./helpers/errors')
@@ -358,10 +359,11 @@ const get = async function (key, options = {}) {
358
359
  return single
359
360
  }
360
361
  } else {
361
- if (options.format === 'eval') {
362
+ if (options.format === 'eval' || options.format === 'eval-export') {
363
+ const prefix = options.format === 'eval-export' ? 'export ' : ''
362
364
  let inline = ''
363
365
  for (const [key, value] of Object.entries(parsed)) {
364
- inline += `${key}=${escape(value)}\n`
366
+ inline += `${prefix}${key}=${escape(value)}\n`
365
367
  }
366
368
  inline = inline.trim()
367
369