Skip to main content
Module

x/faster/deps.ts>copy

A fast and optimized middleware server with an absurdly small amount of code (300 lines) built on top of Deno's native HTTP APIs with no dependencies. It also has a collection of useful middlewares: log file, serve static, CORS, session, rate limit, token, body parsers, redirect, proxy and handle upload. In "README" there are examples of all the resources. Faster's ideology is: all you need is an optimized middleware manager, all other functionality is middleware.
Go to Latest
variable copy
Re-export
Deprecated
Deprecated

(will be removed after 0.169.0) Import from std/streams/copy.ts instead.

Copies from src to dst until either EOF (null) is read from src or an error occurs. It resolves to the number of bytes copied or rejects with the first error encountered while copying.

import { copy } from "https://deno.land/std@0.224.0/streams/conversion.ts";

const source = await Deno.open("my_file.txt");
const bytesCopied1 = await copy(source, Deno.stdout);
const destination = await Deno.create("my_file_2.txt");
const bytesCopied2 = await copy(source, destination);
import { copy } from "https://deno.land/x/faster@v6.5/deps.ts";