diff options
author | Andy Hayden <andyhayden1@gmail.com> | 2019-10-27 06:04:42 -0700 |
---|---|---|
committer | Ry Dahl <ry@tinyclouds.org> | 2019-10-27 09:04:42 -0400 |
commit | aec5a646c9218a0a0da62cbcd1f28bc23c242540 (patch) | |
tree | e052f0263eb2abc4915dc3710ec44ee34e9ad621 /std/examples/curl.ts | |
parent | 51dd91a3ccfd9554bcf69b539f2f748da81c5b12 (diff) |
feat: top-level-for-await (#3212)
Diffstat (limited to 'std/examples/curl.ts')
-rw-r--r-- | std/examples/curl.ts | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/std/examples/curl.ts b/std/examples/curl.ts index 04dd9d601..e020016f8 100644 --- a/std/examples/curl.ts +++ b/std/examples/curl.ts @@ -1,8 +1,4 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. -async function curl(url: string): Promise<void> { - const res = await fetch(url); - await Deno.copy(Deno.stdout, res.body); -} - -await curl(Deno.args[1]); -Deno.exit(0); +const url = Deno.args[1]; +const res = await fetch(url); +await Deno.copy(Deno.stdout, res.body); |