Is is it possible debug NODE REPL. node cmd bring the repl prompt >. within the prompt is it possible to start the debugger. say for eg
> hello = function(){
....debugger;
....console.log('hello');
}
>hello() --> should run in the debugger..
node --debug
is marked for deprecation.
[DEP0062] DeprecationWarning:
node --debug
andnode --debug-brk
are invalid. Please usenode --inspect
ornode --inspect-brk
instead.
node --inspect
is the way moving forward.
Start the repl with node --debug
. Then you can can use node-inspector
(an npm package) from a separate terminal, and debug in your browser with the chrome developer tools by opening http://localhost:8080/debug?port=5858
in chrome. You can, for example, set a breakpoint in the repl.js
file in the complete
function, and if you go to the node repl and hit TAB
, it will trigger the breakpoint and you can debug it.
If you want the coffee-script repl, it's coffee --nodejs --debug
.