From 51e0bfda3c5df4fa1f1b36301193038ed6aaf7bf Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Mon, 12 Jul 2021 19:44:42 +0200 Subject: chore(runtime): deprecate `Deno.copy` (#11369) --- docs/getting_started/first_steps.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'docs/getting_started/first_steps.md') diff --git a/docs/getting_started/first_steps.md b/docs/getting_started/first_steps.md index 9a0fdab7c..fda5bc47b 100644 --- a/docs/getting_started/first_steps.md +++ b/docs/getting_started/first_steps.md @@ -86,10 +86,11 @@ In this program each command-line argument is assumed to be a filename, the file is opened, and printed to stdout. ```ts +import { copy } from "https://deno.land/std@$STD_VERSION/io/util.ts"; const filenames = Deno.args; for (const filename of filenames) { const file = await Deno.open(filename); - await Deno.copy(file, Deno.stdout); + await copy(file, Deno.stdout); file.close(); } ``` @@ -111,12 +112,13 @@ This is an example of a server which accepts connections on port 8080, and returns to the client anything it sends. ```ts +import { copy } from "https://deno.land/std@$STD_VERSION/io/util.ts"; const hostname = "0.0.0.0"; const port = 8080; const listener = Deno.listen({ hostname, port }); console.log(`Listening on ${hostname}:${port}`); for await (const conn of listener) { - Deno.copy(conn, conn); + copy(conn, conn); } ``` -- cgit v1.2.3