File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,12 @@ exports.setEnv = function (var_) {
54
54
} ;
55
55
} ;
56
56
57
+ exports . unsetEnv = function ( var_ ) {
58
+ return function ( ) {
59
+ delete process . env [ var_ ] ;
60
+ } ;
61
+ } ;
62
+
57
63
exports . exit = function ( code ) {
58
64
return function ( ) {
59
65
process . exit ( code ) ;
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ module Node.Process
13
13
, getEnv
14
14
, lookupEnv
15
15
, setEnv
16
+ , unsetEnv
16
17
, pid
17
18
, platform
18
19
, exit
@@ -119,6 +120,10 @@ lookupEnv k = FO.lookup k <$> getEnv
119
120
-- | Set an environment variable.
120
121
foreign import setEnv :: String -> String -> Effect Unit
121
122
123
+ -- | Delete an environment variable.
124
+ -- | Use case: to hide secret environment variable from child processes.
125
+ foreign import unsetEnv :: String -> Effect Unit
126
+
122
127
pid :: Pid
123
128
pid = process.pid
124
129
You can’t perform that action at this time.
0 commit comments