nswbmw / node-in-debugging Goto Github PK
View Code? Open in Web Editor NEW《Node.js 调试指南》
《Node.js 调试指南》
3.6.4节第六题的结果4和7的顺序颠倒了。在node v12.13.0
版本中的顺序为:9 5 8 1 4 7 3 6 2
Code:
docker run -d -p 5601:5601 \
-p 9200:9200 \
-p 5044:5044 \
-p 15044:15044/udp \
-it --name elk sebp/elk
在 4.1.1 什么是 Source Map 章节中 用的 uglify-es
和 source-map-support
这两个npm
包在 https://www.npmjs.com/ 网站 找不到的啊
你的文章中写道下面的两个, 前者表述的含义setTimeout和setInterval在timers阶段执行,后者表示setTimeout和setInterval在poll阶段执行,是否自相矛盾?
每个阶段(phase)的作用:timers:执行 setTimeout() 和 setInterval() 中到期的 callback。
poll 阶段主要有两个功能:
当 timers 的定时器到期后,执行定时器(setTimeout 和 setInterval)的 callback。
执行 poll 队列里面的 I/O callback。
我们看nodejs官方的解释: 这个解释的含义应该是: poll阶段会取回所有的io事件, 执行相关的io回调(换句话说:是除了timers和setimmediate之外的所有事件)。 按照官方的解释,poll阶段并不会执行定时器相关的回调。
poll: retrieve new I/O events; execute I/O related callbacks (almost all with the exception of close callbacks, the ones scheduled by timers, and setImmediate()); node will block here when appropriate. https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/
谢谢 先打赏一点哈哈
在 4.2.4 process._debugProcess 章节中
打开新的终端,运行:node -e "process._debugProcess(53911)" 启动调试后,调试结束后 怎么把debug调试 关闭掉呢 ?在不停止node进程的情况下呢 ?
我在 process 的方法中 找到了 process._debugEnd 方法,但是没有起作用的啊
十分感谢,非常有用
4.5小节hot-reload,setInterval和setTimout热加载也会有问题吧
可以试试 mapbox/flamebearer还有0x
leakMethod这个函数没有引用外部变量为什么是闭包啊。
下面是我的理解:
调试 ES6 modules,现在的方案是先编译成 es5,加上 sourcemap 进行调试。
如果要直接调试,可以使用 babel-node,但是在调试上下文中变量有问题。
使用 nodejs 原生 es6 modules 调试理论上没有问题。
NODE_OPTIONS='--experimental-modules --loader ./custom-loader.mjs' node —inspect-brk x.js
# custom-loader.js 支持加载 nodejs 内置模块,省略 js 后缀的 es6 模块 以及 mjs 后缀的 es6 模块
但是 Chrome 中调试有可能不能在 Filesystem 中看到文件,不方便打断点(需要添加 debugger 语句)
可以在 vscode 中调试:launch.json 中添加 runtimeArgs
整个 Node.js 的调试以及分析,不同工具都有,例子也很详细,感谢提供如此棒的文档。
我们是淘宝的 MidwayJs 团队,最近出品了新的 Node.js 应用管理器 Pandora.js,可以在一定程度上帮助应用开发和调试,可以试试,如有不足也可以反馈给我们。
Node 应用有时候会突然 RSS 爆升,堆内内存是正常的。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.