Skip to main content
promises.cp - fs - Node documentation
function promises.cp
Unstable

Usage in Deno

import { promises } from "node:fs";
cp(
source: string | URL,
destination: string | URL,
opts?: CopyOptions,
): Promise<void>

Asynchronously copies the entire directory structure from src to dest, including subdirectories and files.

When copying a directory to another directory, globs are not supported and behavior is similar to cp dir1/ dir2/.

Parameters

source: string | URL
destination: string | URL
optional
opts: CopyOptions

Return Type

Promise<void>

Fulfills with undefined upon success.