Giter Site home page Giter Site logo

node-inspector's Introduction

Node Inspector is a debugger interface for nodeJS using the WebKit Web Inspector.

Getting Started

Requirements

  • nodeJS
    • versions: 0.1.101 or later
  • A WebKit based browser: Chrome, Safari, OmniWeb, etc.

Install

  • With npm npm install node-inspector
  • Or from source

Debugging

As an example lets debug test/hello.js, from the root project directory (node-inspector)

  1. start the inspector in the background node-inspector &

  2. start the node instance to debug node --debug test/hello.js

  3. open http://127.0.0.1:8080 in your favorite WebKit based browser

    Chrome 5 users MUST use 127.0.0.1 NOT localhost or the browser will not connect to the debugger

  4. you should now see the javascript source from nodeJS

  5. select the hello.js script and set some breakpoints (far left line numbers)

  6. now open http://127.0.0.1:8124/ in a new tab then go back to inspector tab

  7. click "Step over next function call" and observe changes in the RHS panel

  8. then watch http://www.youtube.com/watch?v=AOnK3NVnxL8

For more information on getting started see the wiki

Options

	--web-port=[port]     port to host the inspector (default 8080)

Cool stuff

  • the WebKit Web Inspector debugger is a great js debugger interface, it works just as well for node
  • uses WebSockets, so no polling for breaks
  • remote debugging
  • javascript top to bottom :)
  • edit running code
  • collaborative debugging

Known Issues

This is alpha quality code, so use at your own risk:

  • be careful about viewing the contents of Buffer objects, each byte is displayed as an individual array element, for anything but tiny Buffers this will take too long to render
  • while not stopped at a breakpoint the console doesn't always behave as you might expect
  • pause on exceptions doesn't play nice with the node event loop
  • closing the browser does not stop debugging, you must stop node-inspector manually

TODOS

  • save application settings
  • profiler panel

Thanks

This project respectfully uses code from and thanks the authors of:

node-inspector's People

Contributors

dannycoates avatar markc avatar past avatar

Stargazers

Jeremy Johnstone avatar

Watchers

Jeremy Johnstone avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.