@karmaniverous/get-dotenv 4.0.0-3 → 4.0.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/README.md +51 -57
- package/dist/index.d.cts +13 -13
- package/dist/index.d.mts +13 -13
- package/dist/index.d.ts +13 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -76,62 +76,56 @@ If the value corresponding to a key is a function, it will be executed with the
|
|
|
76
76
|
|
|
77
77
|
Since keys will be evaluated progressively, each successive key function will have access to any previous ones. These keys can also override existing variables.
|
|
78
78
|
|
|
79
|
-
##
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
#
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
--vars-assignor <string> vars assignment operator string (default: "=")
|
|
130
|
-
--vars-assignor-pattern <string> vars assignment operator regex pattern
|
|
131
|
-
-h, --help display help for command
|
|
132
|
-
|
|
133
|
-
Commands:
|
|
134
|
-
cmd execute shell command string (default command)
|
|
135
|
-
help [command] display help for command
|
|
79
|
+
## Command Line Interface
|
|
80
|
+
|
|
81
|
+
You can also use `getdotenv` from the command line:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
> npx getdotenv -h
|
|
85
|
+
|
|
86
|
+
# Usage: getdotenv [options] [command]
|
|
87
|
+
#
|
|
88
|
+
# Base CLI.
|
|
89
|
+
#
|
|
90
|
+
# Options:
|
|
91
|
+
# -e, --env <string> target environment (dotenv-expanded)
|
|
92
|
+
# -v, --vars <string> extra variables expressed as delimited key-value pairs (dotenv-expanded): KEY1=VAL1 KEY2=VAL2
|
|
93
|
+
# -c, --command <string> shell command string (dotenv-expanded)
|
|
94
|
+
# -o, --output-path <string> consolidated output file (dotenv-expanded)
|
|
95
|
+
# -p, --load-process load variables to process.env ON (default)
|
|
96
|
+
# -P, --load-process-off load variables to process.env OFF
|
|
97
|
+
# -a, --exclude-all exclude all dotenv variables from loading ON
|
|
98
|
+
# -A, --exclude-all-off exclude all dotenv variables from loading OFF (default)
|
|
99
|
+
# -z, --exclude-dynamic exclude dynamic dotenv variables from loading ON
|
|
100
|
+
# -Z, --exclude-dynamic-off exclude dynamic dotenv variables from loading OFF (default)
|
|
101
|
+
# -n, --exclude-env exclude environment-specific dotenv variables from loading
|
|
102
|
+
# -N, --exclude-env-off exclude environment-specific dotenv variables from loading OFF (default)
|
|
103
|
+
# -g, --exclude-global exclude global dotenv variables from loading ON
|
|
104
|
+
# -G, --exclude-global-off exclude global dotenv variables from loading OFF (default)
|
|
105
|
+
# -r, --exclude-private exclude private dotenv variables from loading ON
|
|
106
|
+
# -R, --exclude-private-off exclude private dotenv variables from loading OFF (default)
|
|
107
|
+
# -u, --exclude-public exclude public dotenv variables from loading ON
|
|
108
|
+
# -U, --exclude-public-off exclude public dotenv variables from loading OFF (default)
|
|
109
|
+
# -l, --log console log loaded variables ON
|
|
110
|
+
# -L, --log-off console log loaded variables OFF (default)
|
|
111
|
+
# -d, --debug debug mode ON
|
|
112
|
+
# -D, --debug-off debug mode OFF (default)
|
|
113
|
+
# --default-env <string> default target environment
|
|
114
|
+
# --dotenv-token <string> dotenv-expanded token indicating a dotenv file (default: ".env")
|
|
115
|
+
# --dynamic-path <string> dynamic variables path
|
|
116
|
+
# --paths <string> dotenv-expanded delimited list of paths to dotenv directory (default: "./")
|
|
117
|
+
# --paths-delimiter <string> paths delimiter string (default: " ")
|
|
118
|
+
# --paths-delimiter-pattern <string> paths delimiter regex pattern
|
|
119
|
+
# --private-token <string> dotenv-expanded token indicating private variables (default: "local")
|
|
120
|
+
# --vars-delimiter <string> vars delimiter string (default: " ")
|
|
121
|
+
# --vars-delimiter-pattern <string> vars delimiter regex pattern
|
|
122
|
+
# --vars-assignor <string> vars assignment operator string (default: "=")
|
|
123
|
+
# --vars-assignor-pattern <string> vars assignment operator regex pattern
|
|
124
|
+
# -h, --help display help for command
|
|
125
|
+
#
|
|
126
|
+
# Commands:
|
|
127
|
+
# cmd execute shell command string (default command)
|
|
128
|
+
# help [command] display help for command
|
|
136
129
|
```
|
|
137
130
|
|
|
131
|
+
See [this example repo](https://github.com/karmaniverous/get-dotenv-child) for a deep dive on using the `getDotenv` CLI and how to extend it for your own projects.
|
package/dist/index.d.cts
CHANGED
|
@@ -8,14 +8,14 @@ interface GetDotenvCliOptions extends Omit<GetDotenvOptions, 'paths' | 'vars'> {
|
|
|
8
8
|
* Cli alias. Should align with the `bin` property in `package.json`.
|
|
9
9
|
*/
|
|
10
10
|
alias?: string;
|
|
11
|
-
/**
|
|
12
|
-
* Cli description (appears in CLI help).
|
|
13
|
-
*/
|
|
14
|
-
description?: string;
|
|
15
11
|
/**
|
|
16
12
|
* Logs CLI internals when true.
|
|
17
13
|
*/
|
|
18
14
|
debug?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Cli description (appears in CLI help).
|
|
17
|
+
*/
|
|
18
|
+
description?: string;
|
|
19
19
|
/**
|
|
20
20
|
* A delimited string of paths to dotenv files.
|
|
21
21
|
*/
|
|
@@ -78,7 +78,7 @@ interface GetDotenvOptions {
|
|
|
78
78
|
*/
|
|
79
79
|
dotenvToken?: string;
|
|
80
80
|
/**
|
|
81
|
-
* path to
|
|
81
|
+
* path to JS module default-exporting an object keyed to dynamic variable functions
|
|
82
82
|
*/
|
|
83
83
|
dynamicPath?: string;
|
|
84
84
|
/**
|
|
@@ -86,31 +86,31 @@ interface GetDotenvOptions {
|
|
|
86
86
|
*/
|
|
87
87
|
env?: string;
|
|
88
88
|
/**
|
|
89
|
-
* exclude dynamic variables
|
|
89
|
+
* exclude dynamic variables from loading
|
|
90
90
|
*/
|
|
91
91
|
excludeDynamic?: boolean;
|
|
92
92
|
/**
|
|
93
|
-
* exclude environment-specific variables
|
|
93
|
+
* exclude environment-specific variables from loading
|
|
94
94
|
*/
|
|
95
95
|
excludeEnv?: boolean;
|
|
96
96
|
/**
|
|
97
|
-
* exclude global variables
|
|
97
|
+
* exclude global variables from loading
|
|
98
98
|
*/
|
|
99
99
|
excludeGlobal?: boolean;
|
|
100
100
|
/**
|
|
101
|
-
* exclude private variables
|
|
101
|
+
* exclude private variables from loading
|
|
102
102
|
*/
|
|
103
103
|
excludePrivate?: boolean;
|
|
104
104
|
/**
|
|
105
|
-
* exclude public variables
|
|
105
|
+
* exclude public variables from loading
|
|
106
106
|
*/
|
|
107
107
|
excludePublic?: boolean;
|
|
108
108
|
/**
|
|
109
|
-
* load dotenv to process.env
|
|
109
|
+
* load dotenv variables to `process.env`
|
|
110
110
|
*/
|
|
111
111
|
loadProcess?: boolean;
|
|
112
112
|
/**
|
|
113
|
-
* log
|
|
113
|
+
* log loaded dotenv variables to `logger`
|
|
114
114
|
*/
|
|
115
115
|
log?: boolean;
|
|
116
116
|
/**
|
|
@@ -118,7 +118,7 @@ interface GetDotenvOptions {
|
|
|
118
118
|
*/
|
|
119
119
|
logger?: Logger;
|
|
120
120
|
/**
|
|
121
|
-
* if populated, writes consolidated
|
|
121
|
+
* if populated, writes consolidated dotenv file to this path (follows dotenvExpand rules)
|
|
122
122
|
*/
|
|
123
123
|
outputPath?: string;
|
|
124
124
|
/**
|
package/dist/index.d.mts
CHANGED
|
@@ -8,14 +8,14 @@ interface GetDotenvCliOptions extends Omit<GetDotenvOptions, 'paths' | 'vars'> {
|
|
|
8
8
|
* Cli alias. Should align with the `bin` property in `package.json`.
|
|
9
9
|
*/
|
|
10
10
|
alias?: string;
|
|
11
|
-
/**
|
|
12
|
-
* Cli description (appears in CLI help).
|
|
13
|
-
*/
|
|
14
|
-
description?: string;
|
|
15
11
|
/**
|
|
16
12
|
* Logs CLI internals when true.
|
|
17
13
|
*/
|
|
18
14
|
debug?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Cli description (appears in CLI help).
|
|
17
|
+
*/
|
|
18
|
+
description?: string;
|
|
19
19
|
/**
|
|
20
20
|
* A delimited string of paths to dotenv files.
|
|
21
21
|
*/
|
|
@@ -78,7 +78,7 @@ interface GetDotenvOptions {
|
|
|
78
78
|
*/
|
|
79
79
|
dotenvToken?: string;
|
|
80
80
|
/**
|
|
81
|
-
* path to
|
|
81
|
+
* path to JS module default-exporting an object keyed to dynamic variable functions
|
|
82
82
|
*/
|
|
83
83
|
dynamicPath?: string;
|
|
84
84
|
/**
|
|
@@ -86,31 +86,31 @@ interface GetDotenvOptions {
|
|
|
86
86
|
*/
|
|
87
87
|
env?: string;
|
|
88
88
|
/**
|
|
89
|
-
* exclude dynamic variables
|
|
89
|
+
* exclude dynamic variables from loading
|
|
90
90
|
*/
|
|
91
91
|
excludeDynamic?: boolean;
|
|
92
92
|
/**
|
|
93
|
-
* exclude environment-specific variables
|
|
93
|
+
* exclude environment-specific variables from loading
|
|
94
94
|
*/
|
|
95
95
|
excludeEnv?: boolean;
|
|
96
96
|
/**
|
|
97
|
-
* exclude global variables
|
|
97
|
+
* exclude global variables from loading
|
|
98
98
|
*/
|
|
99
99
|
excludeGlobal?: boolean;
|
|
100
100
|
/**
|
|
101
|
-
* exclude private variables
|
|
101
|
+
* exclude private variables from loading
|
|
102
102
|
*/
|
|
103
103
|
excludePrivate?: boolean;
|
|
104
104
|
/**
|
|
105
|
-
* exclude public variables
|
|
105
|
+
* exclude public variables from loading
|
|
106
106
|
*/
|
|
107
107
|
excludePublic?: boolean;
|
|
108
108
|
/**
|
|
109
|
-
* load dotenv to process.env
|
|
109
|
+
* load dotenv variables to `process.env`
|
|
110
110
|
*/
|
|
111
111
|
loadProcess?: boolean;
|
|
112
112
|
/**
|
|
113
|
-
* log
|
|
113
|
+
* log loaded dotenv variables to `logger`
|
|
114
114
|
*/
|
|
115
115
|
log?: boolean;
|
|
116
116
|
/**
|
|
@@ -118,7 +118,7 @@ interface GetDotenvOptions {
|
|
|
118
118
|
*/
|
|
119
119
|
logger?: Logger;
|
|
120
120
|
/**
|
|
121
|
-
* if populated, writes consolidated
|
|
121
|
+
* if populated, writes consolidated dotenv file to this path (follows dotenvExpand rules)
|
|
122
122
|
*/
|
|
123
123
|
outputPath?: string;
|
|
124
124
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -8,14 +8,14 @@ interface GetDotenvCliOptions extends Omit<GetDotenvOptions, 'paths' | 'vars'> {
|
|
|
8
8
|
* Cli alias. Should align with the `bin` property in `package.json`.
|
|
9
9
|
*/
|
|
10
10
|
alias?: string;
|
|
11
|
-
/**
|
|
12
|
-
* Cli description (appears in CLI help).
|
|
13
|
-
*/
|
|
14
|
-
description?: string;
|
|
15
11
|
/**
|
|
16
12
|
* Logs CLI internals when true.
|
|
17
13
|
*/
|
|
18
14
|
debug?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Cli description (appears in CLI help).
|
|
17
|
+
*/
|
|
18
|
+
description?: string;
|
|
19
19
|
/**
|
|
20
20
|
* A delimited string of paths to dotenv files.
|
|
21
21
|
*/
|
|
@@ -78,7 +78,7 @@ interface GetDotenvOptions {
|
|
|
78
78
|
*/
|
|
79
79
|
dotenvToken?: string;
|
|
80
80
|
/**
|
|
81
|
-
* path to
|
|
81
|
+
* path to JS module default-exporting an object keyed to dynamic variable functions
|
|
82
82
|
*/
|
|
83
83
|
dynamicPath?: string;
|
|
84
84
|
/**
|
|
@@ -86,31 +86,31 @@ interface GetDotenvOptions {
|
|
|
86
86
|
*/
|
|
87
87
|
env?: string;
|
|
88
88
|
/**
|
|
89
|
-
* exclude dynamic variables
|
|
89
|
+
* exclude dynamic variables from loading
|
|
90
90
|
*/
|
|
91
91
|
excludeDynamic?: boolean;
|
|
92
92
|
/**
|
|
93
|
-
* exclude environment-specific variables
|
|
93
|
+
* exclude environment-specific variables from loading
|
|
94
94
|
*/
|
|
95
95
|
excludeEnv?: boolean;
|
|
96
96
|
/**
|
|
97
|
-
* exclude global variables
|
|
97
|
+
* exclude global variables from loading
|
|
98
98
|
*/
|
|
99
99
|
excludeGlobal?: boolean;
|
|
100
100
|
/**
|
|
101
|
-
* exclude private variables
|
|
101
|
+
* exclude private variables from loading
|
|
102
102
|
*/
|
|
103
103
|
excludePrivate?: boolean;
|
|
104
104
|
/**
|
|
105
|
-
* exclude public variables
|
|
105
|
+
* exclude public variables from loading
|
|
106
106
|
*/
|
|
107
107
|
excludePublic?: boolean;
|
|
108
108
|
/**
|
|
109
|
-
* load dotenv to process.env
|
|
109
|
+
* load dotenv variables to `process.env`
|
|
110
110
|
*/
|
|
111
111
|
loadProcess?: boolean;
|
|
112
112
|
/**
|
|
113
|
-
* log
|
|
113
|
+
* log loaded dotenv variables to `logger`
|
|
114
114
|
*/
|
|
115
115
|
log?: boolean;
|
|
116
116
|
/**
|
|
@@ -118,7 +118,7 @@ interface GetDotenvOptions {
|
|
|
118
118
|
*/
|
|
119
119
|
logger?: Logger;
|
|
120
120
|
/**
|
|
121
|
-
* if populated, writes consolidated
|
|
121
|
+
* if populated, writes consolidated dotenv file to this path (follows dotenvExpand rules)
|
|
122
122
|
*/
|
|
123
123
|
outputPath?: string;
|
|
124
124
|
/**
|
package/package.json
CHANGED