Skip to content

Instantly share code, notes, and snippets.

@davidbanham
Created November 24, 2014 23:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidbanham/51ca172b3b660ecbabb7 to your computer and use it in GitHub Desktop.
Save davidbanham/51ca172b3b660ecbabb7 to your computer and use it in GitHub Desktop.
NodeJS debugger + repl
// To interact with this file, run `node debug repl.js`
// If you type `next` it will step to the next line
// If you type `cont` it will carry on to the
var foo = 'bar'; // You are stopped here. To go to the next line, type `next`
var bar = 'baz'; // Now you're here! Typing `next` was a lot of keystrokes, you can also type `n`
var baz = 'quux'; // This is still going to take a while. To skip all the way to the next debugger statment, type `cont`
var alice = 'bob';
var bob = 'alice';
debugger; // Check it out! We went all the way here. Now drop into a REPL by typing `repl`. You can save its state with `.save output.js` and exit it with ctrl+C
var lol = 'hai';
debugger;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment