Home > @rushstack/node-core-library > FileSystem > copyFile

FileSystem.copyFile() method

Copies a single file from one location to another. By default, destinationPath is overwritten if it already exists.

Signature:

static copyFile(options: IFileSystemCopyFileOptions): void;

Parameters

Parameter Type Description
options IFileSystemCopyFileOptions  

Returns:

void

Remarks

The copyFile() API cannot be used to copy folders. It copies at most one file. Use FileSystem.copyFiles() if you need to recursively copy a tree of folders.

The implementation is based on copySync() from the fs-extra package.