Commit c176b2b

Anton Medvedev <anton@medv.io>
2021-05-07 18:42:50
Update README.md
1 parent 4c8d602
Changed files (2)
README.md
@@ -186,7 +186,7 @@ Specifies verbosity. Default: `true`.
 In verbose mode prints executed commands with outputs of it. Same as 
 `set -x` in bash.
 
-### Importing
+### Importing from other scripts
 
 It's possible to use `$` and others with explicit import.
 
@@ -196,6 +196,13 @@ import {$} from 'zx'
 await $`date`
 ```
 
+### Passing env variables
+
+```js
+process.env.FOO = 'bar'
+await $`echo $FOO`
+```
+
 ### Executing remote scripts
 
 If arg to `zx` bin starts with `https://`, it will be downloaded and executed.
test.mjs
@@ -68,3 +68,8 @@ function assert(cond, msg) {
   }
   assert(p.exitCode === 1)
 }
+
+{
+  process.env.FOO = 'hi; exit 1'
+  await $`echo $FOO`
+}