In the last 5 years, Node.js is a name that is mentioned so many times in the web developer community. Immediately after being introduced by Ryan Dahl in 2009, Node.js became a new trend of the programming world.
People are still arguing very intensely about its performance, but today we are going to talk about 5 interesting things that you can do when you get started with Node.js in a view of a crazy fan of programming languages.
Table of Contents
- Read more: Node.js in Web Development: Top Key Benefits
For those who want to be a versatile warrior in web development, MEAN Stack will be one of your favorite equipment packs.
It’s a set of 4 following weapons:
- MongoDB for a NoSQL database management system
- Express for a framework which helps us write RESTful APIs in Node.js very quickly
- AngularJS for making single-page applications at the front-end
- Don’t miss: Koa VS Express VS Hapi: Which’s the best Node.js Framework? [Detailed Comparison]
2. Asynchronous programming – Why not?
With other technologies, we may be familiar with the concept of asynchronous or non-blocking tasks. When we want to process a bunch of data that takes time (such as getting data from the server or querying the database) and expect the UI will not be blocked, we use some libraries to do this kind of task on a background thread.
With Node.js, the asynchrony engrains the way we write the lines of code. Functions that receives parameters processes them and then returns something sequentially may become too obsolete with you if you are a Node.js developer.
Now, we have to always think about putting a function as a parameter into another, and then call it when all things are done in the second functions.
Furthermore, if you want to deal with Node.js, you have to deal with the way we use a shared variable just like what we have learnt about mutex and semaphore in Operating Systems.
A beginner may get stuck at some tragedy situations such as Callback Hell or wrong index variable in a loop which contains an asynchronous task.
If you find a way to resolve these kinds of problems yourself, you will realize that working with Node.js is full of fun.
3. JSON is not just formatted text
- Read more: Software Engineer vs Software Developer: What are the differences?
4. The power of NPM
NPM is a packet manager for Node.js. It’s something like RubyGems of Rails, Composer of PHP, Pod of iOS or Maven Central of Android and Java.
But it’s not so simple!
The point is, nowadays, front-end web developers also use npm for their projects. Packets of NPM are small, simple but very helpful for any web development, especially these two libraries for automatic tasks: gulp and grunt.
Another important library is bower – a packet manager for front-end web development, which is installed by using npm.
5. Electron – The future and more
This is a big step in web development because this tool brings web development from the cloud to everyone’s computer.
Although just recently launched, it is showing a superior strength because some very well-known applications such as Visual Studio Code and Slack used it even before it becomes widely available for developers. And the reason for its appearance in this post is that the Electron uses Node.js.
I believe that it takes not so much of our time to export a desktop application from our web apps that are written with Node.js.
Apps using Electron
Finally, above things maybe not enough for you to imagine a very huge growing future of Node.js, but I am sure that at least some of us could find out the exciting points in this new runtime environment.