Untitled

 avatar
unknown
plain_text
2 years ago
503 B
2
Indexable
var fs = require("fs");
var data = 'A Solution of all Technology';
 // Create a writable stream var writerStream = fs.createWriteStream('output.txt'); // Write the data to stream with encoding to be utf8 writerStream.write(data,'UTF8"); // Mark the end of file writerStream.end(); // Handle stream events --> finish, and error writerStream.on('finish', function() {
console.log("Write completed.");
});
writerStream.on('error', function(err){
console.log(err.stack);
console.log("Program Ended");
Editor is loading...