posts - 930,  comments - 588,  views - 402万
< 2025年2月 >
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 1
2 3 4 5 6 7 8

         Node.js是一个可以快速构建网络服务及应用的平台。该平台的构建是基于Chrome's JavaScript runtime,也就是说,实际上它是对Google V8引擎(应用于Google Chrome浏览器)进行了封装。 今天介绍Node.js调式目前有几种方法,Built-in的调试功能我们在这儿不介绍了,在这儿主要介绍第三方的,第一种方法使用:node-inspector

通过npm来安装:

$ npm install -g node-inspector

用以下方法来启动调试:

$ node-debug app.js

然后自动打开默认浏览器,http://127.0.0.1:8080/debug?port=5858, 这里推荐Google Chrome Developer Tools,如下图所示:

nodeinspector11

可以看到Call Stack,Scope  Variables. 支持单步调试。

第二种方法,使用商业产品 WebStorm IDE,是jetbrains公司旗下一款JavaScript 开发工具。被广大中国JS开发者誉为“Web前端开发神器”、“最强大的HTML5编辑器”、“最智能的JavaScript IDE”等。
安装以后,打开相应的项目,Debug如下图:

NodeJSDebugging

从UI界面上,提供了详尽的信息,breakpoint, console,scripts,variables.

 

还有一些Node.js相关的工具:

Profiling with node Profiler
CPU and Memory Profiling with NodeTimelook
Webkit Developer Tools Profiling with Node Webkit Agent
Interactive Cloud9 Debugging Guide here
Heapdumps to Webkit Developer Tools Tool and guide here
Logging Libraries that output Debugging Information Caterpillar Tracer
Flamegraphs with Dtrace and StackVis  Only supported on SmartOS

 

希望对您软件开发有帮助。

您可能感兴趣的文章:

Durandal介绍
Database数据库切片模式


作者:Petter Liu
出处:http://www.cnblogs.com/wintersun/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
该文章也同时发布在我的独立博客中-Petter Liu Blog

posted on   PetterLiu  阅读(3591)  评论(0编辑  收藏  举报
编辑推荐:
· [.NET]调用本地 Deepseek 模型
· 一个费力不讨好的项目,让我损失了近一半的绩效!
· .NET Core 托管堆内存泄露/CPU异常的常见思路
· PostgreSQL 和 SQL Server 在统计信息维护中的关键差异
· C++代码改造为UTF-8编码问题的总结
阅读排行:
· 实操Deepseek接入个人知识库
· CSnakes vs Python.NET:高效嵌入与灵活互通的跨语言方案对比
· 【.NET】调用本地 Deepseek 模型
· Plotly.NET 一个为 .NET 打造的强大开源交互式图表库
· 上周热点回顾(2.17-2.23)
历史上的今天:
2010-06-02 使用T4模板读取XML文件
2009-06-02 Asp.net MVC RTM1.0使用NUnit做测试项目
点击右上角即可分享
微信分享提示