📅  最后修改于: 2022-03-11 15:04:04.309000             🧑  作者: Mango
'use strict';
import fs from 'fs';
let fileContent = 'Anything what you want';
let message = fs.writeFileSync('message.txt', fileContent);
function copyContent(fileName: string, dest: string): boolean {
try {
fs.copyFileSync(fileName, dest);
console.log(dest);
return true;
} catch (err) {
return false;
}
}
console.log(copyContent('message.txt', 'destination.txt'));