* Asynchronously copies `src` to `dest`. `src` can be a file, directory, or * symlink. The contents of directories will be copied recursively. * @param {string | URL} src * @param {string | URL} dest * @param {object} [options] * @param {(err?: Error) => any} callback * @returns {void}
(src, dest, options, callback)
| 3688 | * @returns {void} |
| 3689 | */ |
| 3690 | function cp(src, dest, options, callback) { |
| 3691 | if (typeof options === 'function') { |
| 3692 | callback = options; |
| 3693 | options = undefined; |
| 3694 | } |
| 3695 | callback = makeCallback(callback); |
| 3696 | options = validateCpOptions(options); |
| 3697 | src = getValidatedPath(src, 'src'); |
| 3698 | dest = getValidatedPath(dest, 'dest'); |
| 3699 | lazyLoadCp(); |
| 3700 | cpFn(src, dest, options, callback); |
| 3701 | } |
| 3702 | |
| 3703 | /** |
| 3704 | * Synchronously copies `src` to `dest`. `src` can be a file, directory, or |
no test coverage detected