Skip to main content
cp - node__fs.d.ts - Node documentation
function cp
Unstable

Usage in Deno

```typescript import { cp } from "node:node__fs.d.ts"; ```
cp(
source: string | URL,
destination: string | URL,
callback: (err: ErrnoException | null) => void,
): 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
callback: (err: ErrnoException | null) => void

Return Type

void
cp(
source: string | URL,
destination: string | URL,
callback: (err: ErrnoException | null) => void,
): void

Parameters

source: string | URL
destination: string | URL
callback: (err: ErrnoException | null) => void

Return Type

void