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.

相关推荐
小菜摸鱼11 小时前
Node.js + vue3 大文件-切片上传全流程(视频文件)
前端·node.js
PaytonD13 小时前
LoopBack 2 如何设置静态资源缓存时间
前端·javascript·node.js
许久'18 小时前
环境搭建node.js gnvm
node.js
细节控菜鸡19 小时前
Webpack 核心知识点详解:proxy、热更新、Loader与Plugin全解析
前端·webpack·node.js
spmcor19 小时前
Nest.js 文件分片上传:当大文件来敲门,别慌,我们有“分尸”妙计!
node.js
星空下的曙光1 天前
Node.js crypto模块所有 API 详解 + 常用 API + 使用场景
算法·node.js·哈希算法
青灬河1 天前
实现企业级全栈应用服务框架-Elpis(一)
vue.js·node.js
星空下的曙光2 天前
Node.js events模块所有 API 详解 + 常用 API + 使用场景
node.js
无责任此方_修行中2 天前
我的两次 Vibe Coding 经历,一次天堂,一次地狱
后端·node.js·vibecoding
程序铺子2 天前
如何使用 npm 安装 sqlite3 和 canvas 这些包
javascript·npm·node.js