Answer the question
In order to leave comments, you need to log in
How to write multiple files asynchronously in a NodeJS application?
Good day everyone!
The application has a need to asynchronously write multiple files, the names are in an array
. I'm trying to do this
for (var l = 0; l < self.contentHyperLinks.length; l++) {
var _nameChapter = config.out_folder + getNameChapter(self.contentListItems[l]);
var chapter_stream = Fs.createWriteStream(_nameChapter);
chapter_stream.once('open', function (fd) {
chapter_stream.write(self.contentHyperLinks[l]));
chapter_stream.end();
});
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question