Всем привет. Есть такое задание.
Implement ability to write txt files
path - path of file (includes name of file)
chunks - array of strings which should be written in file
Что я делаю не так?
const fs = require('fs');
function main (path, chunks) {
var path = 'C:\\Users\\project_root\\test.txt';
var stream = fs.createWriteStream(path);
stream.once('open', function(fd) {
stream.write(chunks);
stream.end();
});
}