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.

相关推荐
还不如ctrC+V2 小时前
VScode在 Markdown 编辑器中预览
node.js·json
小小书童安东尼6 小时前
node实现自动生成vue页面,更新router
node.js
斯~内克12 小时前
FreeMarker语法深度解析与Node.js集成实践指南
node.js
薛定谔的猫-菜鸟程序员12 小时前
用Node.js施展文档比对魔法:轻松实现Word文档差异比较小工具,实现Word差异高亮标注(附完整实战代码)
node.js·word·diff算法·word文档差异比较工具
代码小学僧12 小时前
团队协作必备!pnpm 版本管理与 corepack 使用指南
前端·node.js·团队管理
小妖66614 小时前
用 Nodemon 解决 npm run serve 频繁重启服务
前端·npm·node.js
欧先生^_^1 天前
Node.js 简介
node.js
斯~内克1 天前
深入解析Node.js洋葱模型:原理、优势与实战陷阱
node.js
2301_799404911 天前
如何修改npm的全局安装路径?
前端·npm·node.js
(❁´◡双辞`❁)*✲゚*1 天前
node入门和npm
前端·npm·node.js