当前位置:网站首页>Nodejs basic architecture analysis parsing engine directory plug-in installation core module
Nodejs basic architecture analysis parsing engine directory plug-in installation core module
2022-06-10 19:06:00 【Plug in development】
List of articles
Development nodejs Relevant procedures , Need to be right nodejs Have a comprehensive overview , First learn how many existing libraries there are , How is it structured , How to install plug-ins, etc , So when facing the project task , Only in this way can we have the bottom of our hearts .
1.nodejs summary
Node.js It's based on Chrome V8 Engine JavaScript Running environment . V8 The engine performs Javascript Very fast , Very good performance .Node.js An event driver is used 、 Non-blocking type I/O Of JavaScript Model . because web Security considerations for the operating environment , Running in browser JavaScript There are many limitations , In order to make it usable in a wider environment ,nodejs This part of the function is supplemented . This paper mainly introduces its application in front-end interface development , Generally based on Google Chromium Development . The engine name is CEPHtmlEngine, The directory of the parsing engine is shown in the following figure :
2. Basic framework

As shown in the figure above :your code For user code ,node.js The core ,Host environment For the host environment ( Provide all kinds of services , Such as document management , Multithreading , Multi process ,IO etc)
nodejs Part of the :v8 engine, libuv, builtin modules, native modules And other ancillary services .
v8 engine: There are two main functions 1. Functions of virtual machine , perform js Code ( Own code , Third party code and native modules Code for ).2. Provide C++ The function interface , by nodejs Provide v8 initialization , establish context,scope etc. .
libuv: It's event driven asynchronous IO model base , our js Code issue request , In the end by the libuv complete , The callback function we set is in libuv Trigger .
builtin modules: It is from C++ Code written into various modules , Contains crypto,zlib, file stream etc Basic function .(v8 Function interface is provided ,libuv Provide asynchrony IO model base , As well as some nodejs function , by builtin modules Provide services ).
native modules: It is from js It's written in , Provide the library that our application calls , At the same time, these modules depend on builtin modules To get the corresponding service support .
summary : If you put nodejs As a black box , What is exposed to developers is native modules, When we make a request , Request from top to bottom , through native modules, adopt builtin modules Send the request to v8,libuv And other ancillary services , End of request , Then go back from the bottom to the top , Finally, we call our callback function .
3.nodejs Version history
It can be found on the official website , Download required nodejs Installation environment ,https://nodejs.org/en/download/releases/
4.windows Next nodejs Directory structure
download node-v8.17.0-x64 edition , stay windows7 Lower installation , After completion, the directory structure is shown in the figure below :
Open the console and navigate to the directory , You can use npm Command to install other plug-ins . Set the npm After the plug-in installation path , Will automatically create one under the path you set node_modules Folder to store plug-ins .
5.nodejs Plug-in management (npm) The basic function of the module
install npm modular .
view help :npm help/npm h
Install the module :npm install <module name>/ npm install -g <Module Name>
Unloading module :ninstall <Moudle Name>
Displays the modules installed in the current directory :npm list
边栏推荐
- 如何设置 SaleSmartly 以进行 Google Analytics(分析)跟踪
- HelloWorld example of TestNG and how to run it from the command line
- [kuangbin] topic 22 interval DP
- IBOX系统开发核心功能和部分核心源码
- 商业智能BI的服务对象,企业管理者的管理“欲望”该如何实现?
- Chapter 1 SQL operators
- Adobe Premiere basic special effects (card point and transition) (IV)
- How can bi help enterprises reduce labor, time and management costs?
- 企业管理者的质疑,这么多年的信息化,我们的钱花哪去了?
- 阵列信号处理仿真之四——Z变换分析阵列多项式
猜你喜欢

Adobe Premiere foundation - opacity (mixed mode) (XII)

商业智能BI在企业的价值之:业务分析发展决策

Request header field XXXX is not allowed by access control allow headers in preflight response

锐捷x32pro刷openwrt开启无线160MHz

3. Golang并发入门

"Digital transformation, data first", talk about how important data governance is to enterprises

Rk1126 adds a new module

如何设置 SaleSmartly 以进行 Google Analytics(分析)跟踪

关于YUV格式的一些总结

商业智能BI的价值,可视化报表等于商业智能BI吗?
随机推荐
数字化时代,企业如何进行数据安全治理,保障数据资产安全
Cross domain error: when allowcredentials is true, allowedorigins cannot contain the special value "*“
Introduction to ad18 device library import
[Code] neural symbol generation machine
Db2 SQL PL中的控制语句
Huawei cloud hcde Cloud Road phase II: how does Huawei cloud help small and medium-sized manufacturing enterprises' digital transformation?
Adobe Premiere基础(视频的最后一步字幕添加)(六)
第四章 数据类型(三)
Chapter 1 SQL operators
Live broadcast preview | a new era of social interaction, exploring new social experiences in the universe
Adobe Premiere foundation - tool use (selection tool, razor tool, and other common tools) (III)
Rk1126 adds a new module
【数据库语言SPL】写着简单跑得又快的数据库语言 SPL
Array signal processing simulation part IV -- Z-transform analysis array polynomial
3. Golang并发入门
AgI foundation, uncertain reasoning, subjective logic ppt2
【代理】10分钟掌握正向代理和反向代理的本质区别
Jsp基于ssm项目实验室管理系统设计与现实.doc
Adobe Premiere foundation - material nesting (animation of Tiktok ending avatar) (IX)
WordPress 6.0 “Arturo阿图罗” 发布