Question: I have an app built in node.js and I use the node inspector in order to debug.
But it's quite hard because of this:

1. My breakpoints are never saved after I restart the server
2. I cannot put a breakpoint on a file that has not loaded yet; so I have to step into from the first script to the one I want; REALLY PAINFULL!

How do you really debug node.js with node inspector? 

The videos on how to use node.js are quite misleading as everything is into a module...  

<http://www.youtube.com/watch?v=AOnK3NVnxL8> 

or this one the scripts appear are already loaded in the first script  

<http://www.youtube.com/watch?v=HJOH0-g8f6E&feature=mfu_in_order&list=UL> 

Edit:
-----

Nobody can answer this question? :s

Answer: 
The problem with client-side breakpoints is that it's hard to keep track of the breakpoint position when the file changes. Unlike in an editor, it cannot keep track of lines being changed, etc.

@RyanOlds suggestion of using debugger; statements is also a good one, but you have to make sure the debugger is connected before the statement is evaluated, because it is ignored otherwise. Starting with --debug-brk is a good way to force this, because the execution is paused on the first line allowing you to attach the debugger and then continue the execution.

You could try debugging with node's [internal debugger](http://nodejs.org/docs/latest/api/debugger.html).

Edit: However, according to the [v8 DebuggerProtocol](http://code.google.com/p/v8/wiki/DebuggerProtocol) it's possible to set breakpoints on script that hasn't been loaded yet AND you can set breakpoints by function, script and more. It should therefore be possible for node-inspector to keep track of your breakpoints (in a session, or whatever). It doesn't do so right now, though.

Maybe if v8 allows a certain piece of code to trigger a breakpoint, similar to nodes *debugger*?
Edit: It does, you should be able to trigger a break by throwing any old exception (caught or uncaught).
You can use node-codein for inspection. It won't do runtime breakpoints but it should ease the inspection process.

<https://github.com/ketamynx/node-codein/>