projeto-hit/TEST_SERVER1/test/api/helpers/createFile.js

17 lines
328 B
JavaScript
Raw Normal View History

const fs = require('fs');
function createFile(saveDir, rows, fileName) {
var stream = fs.createWriteStream(path.join(saveDir, fileName));
stream.once('open', function (fd) {
rows.forEach(element => {
stream.write(element);
});
stream.end();
});
}
module.exports = createFile