MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / copy

Function copy

javascript/selenium-webdriver/io/index.js:71–82  ·  view source on GitHub ↗

* Copies one file to another. * @param {string} src The source file. * @param {string} dst The destination file. * @return {!Promise } A promise for the copied file's path.

(src, dst)

Source from the content-addressed store, hash-verified

69 * @return {!Promise<string>} A promise for the copied file's path.
70 */
71function copy(src, dst) {
72 return new Promise(function (fulfill, reject) {
73 const rs = fs.createReadStream(src)
74 rs.on('error', reject)
75
76 const ws = fs.createWriteStream(dst)
77 ws.on('error', reject)
78 ws.on('close', () => fulfill(dst))
79
80 rs.pipe(ws)
81 })
82}
83
84/**
85 * Recursively copies the contents of one directory to another.

Callers 4

download_to_tmp_folderFunction · 0.85
unzipFunction · 0.85
copy_folder_contentFunction · 0.85
copyDirFunction · 0.85

Calls 1

onMethod · 0.45

Tested by

no test coverage detected