温馨提示:本站仅提供公开网络链接索引服务,不存储、不篡改任何第三方内容,所有内容版权归原作者所有
AI智能索引来源:http://www.bun.com/reference/node/fs/cp
点击访问原文链接

Node fs.cp function | API Reference | Bun

Node fs.cp function | API Reference | BunBuildDocsReferenceGuidesBlogDiscord/node:fs/cpFcp

Search the reference...

/

BuildDocsReferenceGuidesBlogDiscord/node:fs/cpFcp

function

fs.cpfunction cp(source: string | URL,destination: string | URL,callback: (err: null | ErrnoException) => 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/.

function cp(source: string | URL,destination: string | URL,opts: CopyOptions,callback: (err: null | ErrnoException) => 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/.

Referenced typesinterface URLhash: stringhost: stringhostname: stringhref: stringreadonly origin: stringpassword: stringpathname: stringport: stringprotocol: stringsearch: stringreadonly searchParams: URLSearchParamsusername: stringtoJSON(): string;interface CopyOptionsdereference?: boolean

Dereference symlinks

errorOnExist?: boolean

When force is false, and the destination exists, throw an error.

filter?: (source: string, destination: string) => boolean | Promiseboolean>

Function to filter copied files/directories. Return true to copy the item, false to ignore it.

force?: boolean

Overwrite existing file or directory. _The copy operation will ignore errors if you set this to false and the destination exists. Use the errorOnExist option to change this behavior.

mode?: number

Modifiers for copy operation. See mode flag of ()

preserveTimestamps?: boolean

When true timestamps from src will be preserved.

recursive?: boolean

Copy directories recursively.

verbatimSymlinks?: boolean

When true, path resolution for symlinks will be skipped

Resources

ReferenceDocsGuidesDiscordMerch StoreGitHubBlog 

Toolkit

RuntimePackage managerTest runnerBundlerPackage runner

Project

Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicense

Baked with ❤️ in San Francisco

We're hiring →

Node fs.cp function | API Reference | Bun,AI智能索引,全网链接索引,智能导航,网页索引

    API documentation for function node:fs.cp | Bun