MCPcopy Index your code
hub / github.com/nodejs/node / copyFileSync

Function copyFileSync

lib/fs.js:3668–3679  ·  view source on GitHub ↗

* Synchronously copies `src` to `dest`. By * default, `dest` is overwritten if it already exists. * @param {string | Buffer | URL} src * @param {string | Buffer | URL} dest * @param {number} [mode] * @returns {void}

(src, dest, mode)

Source from the content-addressed store, hash-verified

3666 * @returns {void}
3667 */
3668function copyFileSync(src, dest, mode) {
3669 const h = vfsState.handlers;
3670 if (h !== null) {
3671 const result = h.copyFileSync(src, dest, mode);
3672 if (result !== undefined) return;
3673 }
3674 binding.copyFile(
3675 getValidatedPath(src, 'src'),
3676 getValidatedPath(dest, 'dest'),
3677 mode,
3678 );
3679}
3680
3681/**
3682 * Asynchronously copies `src` to `dest`. `src` can be a file, directory, or

Calls 2

copyFileSyncMethod · 0.45
copyFileMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…