Using async/await with for loop in nodejs

Looping using for or foreach loop to read in sequence in nodejs async function printFiles () {   const files = await getFilePaths()   for (const file of files) {     const contents = await fs.readFile(file, 'utf8')     console.log(contents)   } } Looping using map function to read in parallel in nodejs async function printFiles () { const files = […]

Node, Express microservice with Swagger

In this article, we will discuss creating and testing a Node/Express microservice using Swagger.   Technologies node.js express.js swagger supertest   Installing swagger Before installing swagger for node.js, we need to make sure node and npm are installed. Check the same using following commands : node -v npm -v Now, we can install swagger using […]

Node.js Hello World

Node.js   Node.js is an open-source, cross-platform runtime environment for developing server-side Web applications.   It was created in 2009 by Ryan Dahl.   Dahl was inspired to create Node.js after seeing a file upload progress bar on Flickr. The browser did not know how much of the file had been uploaded and had to […]