Node.js is a javascript-based platform which works on an event-driven non-blocking I/O model, useful for creating data-intensive real-time applications. You may have heard of this definition and probably written a hello world in node.js. But what after that? This article aims at unpacking the actual power of node.js, which the technology industry has embraced with open arms.
Let’s dive in.

Web Server

Node.js can act as a server that can intercept incoming HTTPS or HTTP requests and serve the response accordingly. There are many ways of doing this.

      • Using the platform available http(s) module.
      • Custom frameworks like Express or HapiJS etc.

Whatever option you chose, you can create REST APIs, microservices, mini services – Basically everything under the sun needed to create a Web server.

Bonus: Expressjs Gateway is the only open-source framework for API Gateways. There are other products like APIGEE, which are paid, and not everyone may need it. More on this later, I promise.

 

nodeJS WEB Server -learn node js online training

 


Web Application

Now that we have seen Web Servers and APIs, How about User Interface to complete the stack?? It’s possible!! Even though node.js is a server-side platform, you can write a fully working production-ready web application, including UI. Multiple templating engines were created in order to support UI. Handlebars, jade(pug), mustache are some of the templating engines worth mentioning. The ecosystem around node.js is amazing.

Web Application Architecture

Web Application Architecture using nodejs

By now, you may be wondering, Ok, so for web development, both UI and server-side code APIs are taken care of by node.js. All that is left is DB, and we are all set to roll out production-ready apps. Yes, You are correct. But wait it’s not all. You can do much more, and that is the crux of the article.


Creating Custom Tools / Automation

I work for a client who is one of the top 10 companies to work for. An internal team belonging to this client had created a custom framework to build Rapid Application Web Apps. While everything was good, it needed many steps before the framework was successfully installed on developer machines. Most of the developers felt the setup process was complicated involving multiple steps, and even though there was decent documentation and dedicated slack channels, things were never smooth with the developer experience. I wanted to solve this problem somehow. This is where node.js came into rescue. Follow on to find out more about my journey.
I used node.js to automate the entire process of setting up this framework. The solution involved multiple steps in which some of them are below.

      1. Checking if a particular prerequisite S/W or tools is already installed or not.
      2. Configuring proxy on the Developer machine.
      3. Setup Env variables.
      4. Downloading and Installing npm packages from the registry.

With this in place – We were actually able to save a lot of time for every developer of this company using the client framework. Happy Developer = Quality Software.


Bots

We use slack a lot at work. Slack is one of the many collaborative tools which has made Developer’s life extremely easy. We also have this Service Management Portal by the name Service Now ( ServiceNow is a one-stop platform to support various IT Services) where users/teams would report application failure incidents and often emails were the only notification possible for teams owning the application in question. Emails were not so convenient, especially during weekends, since not many would be online.

The email medium was one main reason for SLA (service level agreement) breach on issue resolution, which in turn led to customer disappointment, leading to financial implications and on and on.
We found a solution to this problem by creating a Bot powered by node.js.

The bot would listen to any new incidents by hooking onto Service Now, and upon a new incident, notify the owner teams on slack. Alerting on slack was the differentiator since slack can be easily installed on a cell phone and is much better than the bulky emails client.

While this is just one example of a bot on slack, there have been many bots created using node.js on other platforms to make day to day life more straightforward. Yet another reason where node.js shines.


Web Scraping

We can use node.js and write crawlers that work on headless browsing and fetch the data.

I was supporting a one-off client who was a beginner in the retail domain and wanted to scrape some data often to generate insights out of it.

We used node.js to achieve this with the help of an exciting node module by the name Cheerio. With Cheerio, you can easily make an HTTP request and get the inner HTML as a JSON object.

There is also a wide variety of selectors available to pinpoint and extract the data we are looking for. Some impressive times we live in.
Wait, node.js can do other stuff as well. We are not done yet.


API Gateways

API Gateways acts as a layer between the user and the API endpoints. API gateways abstract away much work for the Developer and let devs focus on business logic only. From Request-Routing, Composition to Monitoring, Metering and security are some examples of the things which are abstracted away from developers thanks to API Gateways.


Some of the industry leaders for API Gateways include APIGEE, Mulesoft, API Connect, Kong. And there is also Expressjs Gateway. 

The best thing about Expressjs Gateway is that it’s open-source and based on node.js. Interesting huh? 

Take a look at the official site for more details. Though my clients currently are into APIGEE only, I’ve personally played around express.js gateway and with a bit of configuration and yaml knowledge you can get started quickly with it.


CLI Tools

Yes, Command-line interface. If you are like me and love terminals/bash and prefer to script away many things with a simple command, hit that enter key, sit back and watch the magic happen.. you are in for a treat. Like any other scripting language, node.js can help you write a quick script that can run on the command line, and there are already a lot of tools out there that make use of this. If you are working on React or Angular, you would’ve heard of create-react-app or angular/cli. They are all based on node.js and wait; it’s not over. You can also create sophisticated CLI tools very easily using node.js. There are a lot of popular npm modules to help you here like prompts, inquirer, colors, chalk, minimist, ora or cli-spinner.


Machine Learning

Oh, this one must have surprised you right? Artificial Intelligence (AI) / Machine Learning(ML) is one of the hottest trends across the globe now and something sure to have on your CVs.

ML usually involves a lot of number crunching and needs a lot of processing power. Applications we write on node.js typically need to be data-intensive with a lot of input/output, and since Javascript is single-threaded, node was not so suitable during the initial days for CPU intensive processing.

However, node.js has been evolving for a decade now, and there are new features like Workers (threads), and also some node.js based ML libraries make use of browsers since browsers are multi-threaded. Libraries like TensorFlow.js, ml.js are some worthy mentionable.


Summary

Ladies and Gentleman, that is the capability of node.js in a nutshell. This is only a quick introduction to what node.js can do.

There is plenty more awaiting when you get your hands dirty and see all these things in action. Excited? I’m more than sure you are 🙂


What Next

In case you are working for a corporate firm, talk to your training and development department in your company and request them to have you & your team trained on node.js.

If you are an individual and looking for your first job or your next big jump in the industry, be sure that you are in the right place. Nodejs is one of the hot technologies in the market, and also the foreseeable future as well.

Have a node.js developer as your work title can attract more quality jobs easily. We @ Technovids are committed to helping you and your team become quickly competitive with node.js and develop applications aligning to industry standards. Join Our Node.js online Training Classes. We wish you only the best.

Best Regards, Team Technovids


About the Author

Sandeep Gokhale is an Aspiring Author who loves empowering people by sharing his expertise on various platforms. Sandeep works full time as a Lead Solution Architect for Asia’s leading Consulting Company with 13 yrs of experience in Architecting, Solutioning, Designing, and Developing enterprise-scale applications for customers across the globe.

LinkedIn : https://www.linkedin.com/in/sandeepgokhale/

Twitter : https://twitter.com/thegokhale

Upskill yourself now

Request A Free Demo Today !

Contact
Course Advisor

drop us a line