FastFoodCoding

Login


Connect with one of the following accounts





Login

Please wait while we redirect...

Views: 210   



Using NodeJS's filesystem module i.e fs you can write content into a file using the following code.

var fs = require('fs');

fs.writeFile('/path/to/file/filename.txt', 'File content, This will be written in the file' , function(err) {
    if(err) {
        console.log(err);
    }
    console.log('Successfully written the file content');
});

Note: Please replace /path/to/file/filename.txt with the file you want to create including the path.




On By


Top Tutorials

Top Questions

Top Articles

Top Blogs

Top News