-
-
Save ry/49f21bc8e56c25fd45fd0aa44b17d531 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/website/manual.md b/website/manual.md | |
index 4025e5ac..de489ed8 100644 | |
--- a/website/manual.md | |
+++ b/website/manual.md | |
@@ -425,7 +425,7 @@ $ deno run --allow-net=deno.land allow-net-whitelist-example.ts | |
Example: | |
```ts | |
-async function main() { | |
+window.onload = async function() { | |
// create subprocess | |
const p = Deno.run({ | |
args: ["echo", "hello"] | |
@@ -434,8 +434,6 @@ async function main() { | |
// await its completion | |
await p.status(); | |
} | |
- | |
-main(); | |
``` | |
Run it: | |
@@ -450,7 +448,7 @@ By default when you use `Deno.run()` subprocess inherits `stdin`, `stdout` and | |
you can use `"piped"` option. | |
```ts | |
-async function main() { | |
+window.onload = async function() { | |
const decoder = new TextDecoder(); | |
const fileNames = Deno.args.slice(1); | |
@@ -480,8 +478,6 @@ async function main() { | |
Deno.exit(code); | |
} | |
- | |
-main(); | |
``` | |
When you run it: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment