summaryrefslogtreecommitdiff
path: root/docs/examples/tcp_echo.md
diff options
context:
space:
mode:
authorLuca Casonato <hello@lcas.dev>2021-07-12 19:44:42 +0200
committerGitHub <noreply@github.com>2021-07-12 19:44:42 +0200
commit51e0bfda3c5df4fa1f1b36301193038ed6aaf7bf (patch)
treef730a56750444a94fdb42e508326d61754d24e07 /docs/examples/tcp_echo.md
parent00484d24ba93418bbdde8e42483d56e3714efaa0 (diff)
chore(runtime): deprecate `Deno.copy` (#11369)
Diffstat (limited to 'docs/examples/tcp_echo.md')
-rw-r--r--docs/examples/tcp_echo.md8
1 files changed, 5 insertions, 3 deletions
diff --git a/docs/examples/tcp_echo.md b/docs/examples/tcp_echo.md
index a66fe05ed..f016b8bd8 100644
--- a/docs/examples/tcp_echo.md
+++ b/docs/examples/tcp_echo.md
@@ -4,8 +4,9 @@
- Listening for TCP port connections with
[Deno.listen](https://doc.deno.land/builtin/stable#Deno.listen).
-- Use [Deno.copy](https://doc.deno.land/builtin/stable#Deno.copy) to take
- inbound data and redirect it to be outbound data.
+- Use
+ [copy](https://doc.deno.land/https/deno.land/std@$STD_VERSION/io/util.ts#copy)
+ to take inbound data and redirect it to be outbound data.
## Example
@@ -16,10 +17,11 @@ returns to the client anything it sends.
/**
* echo_server.ts
*/
+import { copy } from "https://deno.land/std@$STD_VERSION/io/util.ts";
const listener = Deno.listen({ port: 8080 });
console.log("listening on 0.0.0.0:8080");
for await (const conn of listener) {
- Deno.copy(conn, conn).finally(() => conn.close());
+ copy(conn, conn).finally(() => conn.close());
}
```