├── .gitignore
├── libuv-simple
├── libuv-simple
│ ├── text.txt
│ └── main.c
└── libuv-simple.xcodeproj
│ ├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcuserdata
│ │ └── zf.xcuserdatad
│ │ └── UserInterfaceState.xcuserstate
│ ├── xcuserdata
│ └── zf.xcuserdatad
│ │ └── xcschemes
│ │ └── xcschememanagement.plist
│ └── project.pbxproj
├── fz.js
├── docs
├── assets
│ ├── now.png
│ ├── origin.png
│ ├── time-wheel.png
│ └── diifer-socket.png
├── leftSider.md
├── index.html
├── v8.md
├── modulejs.md
├── modulejs2.md
├── timer.md
├── cluster.md
├── process.md
├── modulec++.md
├── a-nextTick.md
├── stream.md
└── eventloop-libuv.md
├── n.js
├── package.json
├── binding.gyp
├── node.test.js
├── README.md
├── .vscode
└── launch.json
├── hello.cc
├── writable.js
└── readable.js
/.gitignore:
--------------------------------------------------------------------------------
1 | Release
--------------------------------------------------------------------------------
/libuv-simple/libuv-simple/text.txt:
--------------------------------------------------------------------------------
1 | i m file
2 |
--------------------------------------------------------------------------------
/fz.js:
--------------------------------------------------------------------------------
1 | function Add(a, b) {
2 | return a + b
3 | }
4 |
5 | module.exports = Add
6 |
--------------------------------------------------------------------------------
/docs/assets/now.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Foveluy/Fz-node/HEAD/docs/assets/now.png
--------------------------------------------------------------------------------
/n.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs')
2 |
3 | fs.createReadStream('./README.md').pipe(process.stdout)
--------------------------------------------------------------------------------
/docs/assets/origin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Foveluy/Fz-node/HEAD/docs/assets/origin.png
--------------------------------------------------------------------------------
/docs/assets/time-wheel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Foveluy/Fz-node/HEAD/docs/assets/time-wheel.png
--------------------------------------------------------------------------------
/docs/assets/diifer-socket.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Foveluy/Fz-node/HEAD/docs/assets/diifer-socket.png
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "fz-node",
3 | "version": "",
4 | "description": "基于8.9.3版本的源码阅读、解析"
5 | }
6 |
--------------------------------------------------------------------------------
/binding.gyp:
--------------------------------------------------------------------------------
1 | {
2 | "targets": [
3 | {
4 | "target_name": "addon",
5 | "sources": [ "hello.cc" ]
6 | }
7 | ]
8 | }
--------------------------------------------------------------------------------
/node.test.js:
--------------------------------------------------------------------------------
1 | setImmediate(()=>{
2 | console.log('setImmediate')
3 | })
4 |
5 | process.nextTick(()=>{
6 | console.log('nextTick')
7 | })
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Node.js 源码解析
2 |
3 | 基于8.9.3版本的源码阅读、解析
4 |
5 |
6 | # 本书地址
7 |
8 | - [书地址](https://215566435.github.io/Fz-node/)
9 | - [本书基于TrumpDoc](https://github.com/215566435/TrumpDoc)
10 |
11 |
12 |
13 | # 协议
14 |
15 | MIT
16 |
--------------------------------------------------------------------------------
/libuv-simple/libuv-simple.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/libuv-simple/libuv-simple.xcodeproj/project.xcworkspace/xcuserdata/zf.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Foveluy/Fz-node/HEAD/libuv-simple/libuv-simple.xcodeproj/project.xcworkspace/xcuserdata/zf.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/docs/leftSider.md:
--------------------------------------------------------------------------------
1 | * [Libuv事件循环](eventloop-libuv.md)
2 | * [timer](timer.md)
3 | * [多进程架构:process](process.md)
4 | * [多进程架构:cluster](cluster.md)
5 | * [模块化c++层](modulec++.md)
6 | * [模块化js层](modulejs.md)
7 | * [模块化js层2](modulejs2.md)
8 | * [Stream模块](stream.md)
9 | * [附录:nextTick实现和优化](a-nextTick.md)
10 | * [本书Github](https://github.com/215566435/Fz-node)
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // 使用 IntelliSense 了解相关属性。
3 | // 悬停以查看现有属性的描述。
4 | // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "type": "node",
9 | "request": "launch",
10 | "name": "启动程序",
11 | "program": "${file}"
12 | }
13 | ]
14 | }
--------------------------------------------------------------------------------
/libuv-simple/libuv-simple.xcodeproj/xcuserdata/zf.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | libuv-simple.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/hello.cc:
--------------------------------------------------------------------------------
1 | // hello.cc
2 | #include
3 |
4 | namespace demo {
5 |
6 | using v8::FunctionCallbackInfo;
7 | using v8::Isolate;
8 | using v8::Local;
9 | using v8::Object;
10 | using v8::String;
11 | using v8::Value;
12 |
13 | void Method(const FunctionCallbackInfo& args) {
14 | Isolate* isolate = args.GetIsolate();
15 | args.GetReturnValue().Set(String::NewFromUtf8(isolate, "world"));
16 | }
17 |
18 | void init(Local