Skip to content

go-oleg/debug-live

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Debug Live

This little tool lets you debug your running node.js applications without setting breakpoints!

  • Get and set variable values
  • Run any JavaScript you want
  • No need to interrupt the application with breakpoints

Installation

npm install debug-live

Usage

//require debug-live
var debugLive = require("debug-live");

//paste in this snippet of code
//(the second parameter is the configurable port Debug Live should run on)
debugLive(function (exprToEval) {
  return eval(exprToEval);
},1337);

//let your app do what it needs to do
var counter = 0;

setInterval(function() {
  counter++;
},100);

var a = {
  a : "abc",
  b : "def"
};

Start your app, telnet to Debug Live, and look at all those variables!

$ telnet localhost 1337
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Welcome to the Live Debugger:
>counter
36
>counter
51
>counter
70
>a
[object Object]
>a.a
abc
>a.b
def
>a.b.c
undefined
>a.doesntExist.a
TypeError: Cannot read property 'a' of undefined
>a
[object Object]
>JSON.stringify(a, null, "\t")
{
	"a": "abc",
	"b": "def"
}
>

Inspiration

The inspiration for Debug Live came from this Stack Overflow question.

About

Debug a running node.js app without breakpoints!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published