@@ -2133,7 +2133,7 @@ $ node negate.js --no-logfile --logfile=test.log --color --no-color
21332133{ logfile:  ' test.log' :  false  }
21342134` ` ` 
21352135
2136- ## `  util .parseEnv (content)` 
2136+ ## `  util .parseEnv (content, sections )` 
21372137
21382138<!-- YAML 
21392139added: 
@@ -2143,28 +2143,72 @@ added:
21432143
21442144> Stability: 1.1 - Active development 
21452145
2146- * `  content`  {string}
2146+ * `  content`  {string} The con
2147+   The raw contents of a `  .env `  file.
21472148
2148- The raw contents of a `  .env `  file.
2149+ * `  options` 
2150+ 
2151+   * `  sections`  {string\[ ]} (optional)
2152+     The sections to take from the content 
21492153
21502154* Returns: {Object} 
21512155
2152- Given an example  ` . env `  file :
2156+ Examples :
21532157
21542158` ` ` 
21552159const  { parseEnv  } =  require (' node:util' 
21562160
2157- parseEnv (' HELLO=world\n HELLO=oh my\n ' 
2161+ parseEnv (` 
2162+ HELLO=world 
2163+ HELLO=oh my 
2164+ ` 
21582165//  Returns: { HELLO: 'oh my' }
21592166` ` ` 
21602167
21612168` ` ` 
21622169import  { parseEnv  } from  ' node:util' 
21632170
2164- parseEnv (' HELLO=world\n HELLO=oh my\n ' 
2171+ parseEnv (` 
2172+ HELLO=world 
2173+ HELLO=oh my 
2174+ ` 
21652175//  Returns: { HELLO: 'oh my' }
21662176` ` ` 
21672177
2178+ ` ` ` 
2179+ const  { parseEnv  } =  require (' node:util' 
2180+ 
2181+ parseEnv (` 
2182+   X = x 
2183+   Y = y 
2184+ 
2185+   [section-a] 
2186+   X = x_a 
2187+ 
2188+   [section-b] 
2189+   Y = y_b 
2190+   Z = z_b 
2191+ ` :  [' section-b' 
2192+ //  Returns: { X: 'x', Y: 'y_b', Z: 'z_b' }
2193+ ` ` ` 
2194+ 
2195+ ` ` ` 
2196+ import  { parseEnv  } from  ' node:util' 
2197+ 
2198+ parseEnv (` 
2199+   X = x 
2200+   Y = y 
2201+ 
2202+   [section-a] 
2203+   X = x_a 
2204+ 
2205+   [section-b] 
2206+   Y = y_b 
2207+   Z = z_b 
2208+ ` :  [' section-b' 
2209+ //  Returns: { X: 'x', Y: 'y_b', Z: 'z_b' }
2210+ ` ` ` 
2211+ 
21682212## `  util .promisify (original)` 
21692213
21702214<!-- YAML 
0 commit comments