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.

相关推荐
东方小月6 小时前
从零开发一个 Coding Agent(九):实现 Agent 的工具调用闭环
人工智能·前端框架·node.js
王八八。1 天前
nvm 安装与配置完全指南:从零到多版本 Node.js 自由切换
node.js
紫禁玄科1 天前
Shai-Hulud:npm生态的自我复制蠕虫风暴
前端·npm·node.js
烂蜻蜓1 天前
Node.js入门教程(十四):async/await
node.js
谢小飞3 天前
大文件上传很难?学会这招,GB文件秒传不是梦
前端·node.js
周小董4 天前
[1367]npm 安装 canvas 报错 node-gyp ERR
前端·npm·node.js
张龙6874 天前
Node.js 内存泄漏排查实战:从内存曲线到堆快照,一条可复用的定位路径
性能优化·node.js
烂蜻蜓4 天前
Node.js入门教程(七):工作机制
node.js
凌云拓界5 天前
NodeVerdict | .ndv 二进制格式:为 WASM 解码器设计的紧凑布局
安全·架构·开源·node.js·编辑器·软件工程·wasm
凌云拓界5 天前
NodeVerdict | 性能门禁:把追踪数据变成 CI 规则
ci/cd·信息可视化·开源·node.js·bug·数据可视化·安全架构