1 min read

node.js Convert Blocking

Everyone don’t knows why important to write non-blocking programs in Node.js. Here is some code using non-blocking function “readFile()

Read the contents of ‘index.html’ and log them to the console.

 var fs = require('fs');  
 fs.readFile('index.html', function(err, contents){  
  console.log(contents);  
 });  
Share your Love

Leave a Reply

Your email address will not be published. Required fields are marked *