📌  相关文章
📜  javascript 创建文本文件 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:46.799000             🧑  作者: Mango

代码示例1
const fs = require('fs');

fs.writeFile("/tmp/test", "Hey there!", function(err) {
    if(err) {
        return console.log(err);
    }
    console.log("The file was saved!");
}); 

// Or
fs.writeFileSync('/tmp/test-sync', 'Hey there!');