JS如何调用C++

image.png
image.png
c-ares 实现DNS解析
http-parser 解析http
openSSL来做hts
zlib 加密
image.png
最上层,用js直接调用
bindings

深入理解
https://github.com/yjhjstz/deep-into-node

image.png
image.png

Node.js API

api

Assertion
断言,测试代码
async hooks
异步钩子

*buffer
一小段缓存,比如http请求,用户上传一个文件,文件是一点一点上传,每次上传一点都是一段buffer

*Child Processes
子进程
2个v9 nodejs分别处理不同的事情

*cluser
集群
多个nodejs综合到一起,分主次关系做不同事情

*debugger
调试

event
发布订阅模式 event hub

file system
对文件增删改查

global全局变量
image.png

HTTP

PATH 路径

Process
当前进程相关信息

Query sTRINGs
对url进行处理

Stream
流格式处理

timers
计时器

url
处理url

worker threads
v10才有的新系统

学习路线

image.png