mirror of
https://github.com/denoland/deno.git
synced 2024-12-29 02:29:06 -05:00
02bc58d832
- Removes the __fetch namespace from `deno types` - Response.redirect should be a static. - Response.body should not be AsyncIterable. - Disables the deno_proxy benchmark - Makes std/examples/curl.ts buffer the body before printing to stdout
10 lines
389 B
TypeScript
10 lines
389 B
TypeScript
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
|
const url_ = Deno.args[0];
|
|
const res = await fetch(url_);
|
|
|
|
// TODO(ry) Re-enable streaming in this example.
|
|
// Originally we did: await Deno.copy(Deno.stdout, res.body);
|
|
// But maybe more JS-y would be: res.pipeTo(Deno.stdout);
|
|
|
|
const body = new Uint8Array(await res.arrayBuffer());
|
|
await Deno.stdout.write(body);
|