nodejs创建文件

var fs = require('fs');
fs.writeFile(path + "test.txt", "hello world!", function(err) {
    if(err) {
        return console.log(err);
    }
    console.log("The file was saved!");
});

猜你喜欢

转载自www.cnblogs.com/navysummer/p/10684063.html