Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/deno/cli/js/deno.ts>copyFile

A modern runtime for JavaScript and TypeScript.
Go to Latest
function copyFile
import { copyFile } from "https://deno.land/x/deno@v0.30.0/cli/js/deno.ts";

Copies the contents of a file to another by name.

Creates a new file if target does not exists, and if target exists, overwrites original content of the target file.

It would also copy the permission of the original file to the destination.

  await Deno.copyFile("from.txt", "to.txt");

Parameters

from: string
to: string

Returns

Promise<void>