Read the original article here
1) What is Node.js?
Node.js is a JavaScript run-time built on Chrome's V8 JavaScript engine.
Nodejs is an open-source, cross-platform and JavaScript run-time environment. It is a lightweight framework used to develop server-side web applications.
Node.js is built upon Google Chrome’s V8 run-time—written in C++, built for multiple operating systems and super fast.
The use of JavaScript also means that transforming JSON data—the most common data interchange format on the Web—is fast by default.
Node.js used for creating large scale application development, mostly used for video streaming websites, single page application, and other web applications.
65 Best NodeJs Interview Questions - Explore more...
Setup a Node.js Development Environment on Windows, Mac and Linux -
It is easy to install Node.js on Mac, Windows and Linux. Simply you can go to Node.js official site and download you installer (Mac, Windows and Linux), and then execute the installer as per you and after that your window installer you received a text messages looks like, “Congrats!! You successfully installed Node.js on Windows!!”
Node.js Installer Following Steps,
- Download the Windows installer from Nodejs.org official site.
- Click and Run the installer (.msi installer package).
- Follow the prompts instructions of the installer (Accept the agreement and click the NEXT button)
- Restart your computer to get everything working in your command line interface (CLI).
Download Installer,
Download Node.js built installer and source code as for you, for Window, Mac and Linux with NPM and after that you can start developing applications.
The NPM is located in the directory where the Node.js is installed.
Update to Node.js, simply goes to Node.js official site and downloads Windows, Mac and Linux installer, and then executes the installer. Now your latest version of Node.js is updated on your machine.
2) Why Node.js?
The main reasons to use Node for what I do - which is building backend APIs for mobile and web application:
- Non-blocking asynchronous I/O (blocking I/O doesn’t scale for high concurrency)
- Single-threaded event loop (like nginx and Redis - read: FAST)
- Event-driven servers
- Real lexical closures (like Haskell and Scheme - unlike Java and C++)
- Built-in support for promises and generator-based Coroutines
- HTTP/2 in the core (I don’t know of any other language/runtime that has a built-in support for HTTP/2 with no need to install any dependencies, at the time of this writing)
- Excellent support for building REST, GraphQL and WebSocket servers, with Socket.io for legacy clients.
3) Who Is the creator of Node.js?
Ryan Dahl is the creator of Node.js. The development was sponsored by Joyent.
4) When it was initially released?
It was initially released in 2009.
5) In which Language Node Js is written?
Node.js is written in C, C++, and JavaScript. It uses Google’s open source V8 JavaScript Engine to convert JavaScript code to C++.
6) What Is npm?
The NPM is Node.js' package ecosystem. It is the largest ecosystem of open-source libraries in the world. It is also the name of the command line package manager used to interact with npm.
Uninstall Node.js and NPM -
You can uninstall Node.js and NPM same as like your other software. The following steps as below,
- Open your windows control panel.
- Choose the programs & features option.
Click to “uninstall a program”.
Select installed Node.js, and click the uninstall link.
5) What is the name of the file which npm uses to identify the project and its dependencies?
Its name is package.json.
8) Can we use other Engines than V8?
Yes! Microsoft Chakra is another JavaScript engine which can be used with Node.js. It’s not officially declared yet.
9) What Are Benefits of using Node.js?
- Very Fast
- Asynchronous
- Scalable
- Open Source
- No Buffering
- Highly optimized V8 engine
- Excellent JIT
- Fantastic library of ready to use modules on npm
- Great support for C++ extensions if you need threads for CPU-bound operations
- A lots of great test frameworks, linters and other tooling
10) What Is the current version of Nodejs?
Click to know the detail about the - Latest Nodejs Version
11) Where To Downloads and Install?
The Latest LTS Version: 12.13.1 (includes npm 6.12.1)
Download the Node.js source code or a pre-built installer for your platform, and start developing today.
The Downloads link…
12) How To upgrading Node.js to latest version?
Windows:
You just download and reinstall node from the “.msi” in Windows from the node website.
Linux/Mac:
The module n makes version-management easy:
sudo npm install n -g
For the latest stable version:
sudo n stable
For the latest version:
sudo n latest
13) When Should We Use Node.js?
Nodejs can be used to develop:
- Node used for general Purpose Applications
- Node used for real-Time Web Applications
- Node used for developing chat applications
- Node used for developing network applications
- Node used for developing game servers
- Node used for distributed systems
14) When To Not Use Node.Js?
Node is a single threaded framework, so we should not use where the application requires long processing time, or taking so much time for any calculations.
15) For Node.js, Why Google uses V8 Engine?
Google uses V8 as it is a Chrome runtime engine that converts JavaScript code into native machine code.
These, in turn, speeds up the application execution and response process and give you a fast running application.
16) What Are the Features of Node.js?
The list of Node Features:
- It is open source
- High Scalability
- It is extremely Simple and Fast
- No Buffering
- Single-Threaded
- Asynchronous
- Async stack traces
- Faster await
- Cross-Platform
- Faster suite
- Easy to Learn
- Easy to Scale
- Caching
- Data Streaming
- Hosting
- Single Programming Language
- Real-time web applications
- import / export statements supported (no bundler required)
- Faster parsing of JavaScript
- Faster calls with arguments mismatch
- And some other Improvements like - Heap Size, Native Modules N-API
- License: It is been released under MIT license.
17) How To check the NPM version?
You can always check the version with following command:
npm -version
18) How To check the Node version?
You can always check the version with following command:
node –v
19) What modules that Nodejs offers?
Three modules that Nodejs offers:
- Core Modules
- Local Modules
- Third-party modules
Core Modules -
Generally, Core modules get loaded just after the initiation of the Node process.
Local Modules -
The Local modules are created locally by the user or dedicated software developer. All such modules may have several functionalities grouped into different files and folders. And all these can be distributed in the Nodejs community with the help of Node Package Manager.
Third-party modules or External Modules -
The third-party modules by downloading them through Node Package Manager.
Top comments (2)
Hey Anil.
This looks like a good post here. Can you share this in full on DEV?
DEV generally asks that folks share their posts in full if possible and there is tooling provided (dev.to/settings/publishing-from-rss) to make it so that it's relatively easy to repost from outside blogs.
Hope you'll consider sharing the full post going forward.
I saw other posts not being formatted correctly so could you check if RSS feed (if importing from it) is exporting correctly?
This post from my tech blog - code-sample.com. Please tell me the steps to do the same on blogger.