What is Node.JS and its Pros and Cons

What is Node.JS and its Pros and Cons

JavaScript is a client-side development tool.

Node.js is a server-side development tool. And it's only a runtime environment based on Chrome V8 so we don't write some code in Node.js.

Pros:

JavaScript on a server

First I want to emphasis that Node.JS is just a runtime environment of JavaScript. Express is based on Node.js. So based on Node.JS, the project can inherit JavaScript merit (lightweight, fewer code compared with Java or C) and can use its libraries.

And front-end and back-end can use the same language.

Code for microservices

Node module can help implement microservice philosophy. To be specfic, a project is made up of many modules which are isolated and independent. You can just fix or add one module, which doesn't influence other module.

Fast

Node.JS is event-based and single thread . It can process several events concurrently, which leads to improve CPU usage.

Support and Community

There are many companies which use Node.js. And there are many people in Node.js community to provide many solutions and solve the issues.

Packages

There are many packages to solve different problems in NPM. NPM is a place that can install packages.

Easy to learn

Node.JS inherit many features of JavaScript.

Cons:

CPU bottleneck

Because Node.JS is single-thread. So if there are many heavy-computation requests, the thread pool will block. Sometimes we can "expand" the thread pool.

Immature tool

NPM registry is not mature.

Few experienced developers

There are few Node.JS developers who has 2 years or more experience.

相关推荐
Amy_cx1 小时前
npm install安装缓慢或卡住不动
前端·npm·node.js
m0_7482299913 小时前
从零到上线:Node.js 项目的完整部署流程(包含 Docker 和 CICD)
docker·容器·node.js
yqcoder13 小时前
node.js 文件操作
node.js
木偶☜14 小时前
Node.js接收文件分片数据并进行合并处理
服务器·javascript·arcgis·node.js
梦魇梦狸º16 小时前
node安装与管理
macos·node.js
16年上任的CTO17 小时前
一文大白话讲清楚webpack基本使用——6——热更新及其原理
前端·webpack·node.js·热更新·hmr·热重载
1234Wu17 小时前
NodeJs如何做API接口单元测试? --【elpis全栈项目】
单元测试·node.js
16年上任的CTO18 小时前
一文大白话讲清楚webpack基本使用——1——完成webpack的初步构建
前端·webpack·node.js
Nejosi_念旧19 小时前
包文件分析器 Webpack Bundle Analyzer
前端·webpack·node.js
Libby博仙19 小时前
VUE3 vite下的axios跨域
前端·javascript·vue.js·前端框架·node.js