mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 21:00:01 +08:00
Add copyFile to node file system (#20185)
This commit is contained in:
@@ -339,6 +339,16 @@ namespace fs_tests {
|
||||
const v2 = fs.realpathSync('/path/to/folder', { encoding: s });
|
||||
typeof v2 === "string" ? s = v2 : b = v2;
|
||||
}
|
||||
|
||||
{
|
||||
fs.copyFile('/path/to/src', '/path/to/dest', (err) => console.error(err));
|
||||
fs.copyFile('/path/to/src', '/path/to/dest', fs.constants.COPYFILE_EXCL, (err) => console.error(err));
|
||||
|
||||
fs.copyFileSync('/path/to/src', '/path/to/dest', fs.constants.COPYFILE_EXCL);
|
||||
|
||||
const cf = util.promisify(fs.copyFile);
|
||||
cf('/path/to/src', '/path/to/dest', fs.constants.COPYFILE_EXCL).then(console.log);
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user