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

Function copyFile

lib/internal/fs/promises.js:1331–1347  ·  view source on GitHub ↗
(src, dest, mode)

Source from the content-addressed store, hash-verified

1329}
1330
1331async function copyFile(src, dest, mode) {
1332 const h = vfsState.handlers;
1333 if (h !== null) {
1334 const promise = h.copyFile(src, dest, mode);
1335 if (promise !== undefined) { await promise; return; }
1336 }
1337 return await PromisePrototypeThen(
1338 binding.copyFile(
1339 getValidatedPath(src, 'src'),
1340 getValidatedPath(dest, 'dest'),
1341 mode,
1342 kUsePromises,
1343 ),
1344 undefined,
1345 handleErrorFromBinding,
1346 );
1347}
1348
1349// Note that unlike fs.open() which uses numeric file descriptors,
1350// fsPromises.open() uses the fs.FileHandle class.

Callers

nothing calls this directly

Calls 1

copyFileMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…