5

I was wondering if there was a way to list all scope variables (and possibly outer scopes as well) in the built in node.js debugger. So far I've managed to access the global scope using:

debug> repl
> global

but is there a function that lists local scope variables or a pointer to the local scope?
See the debugger commands and global object for more info.

4
  • That is your reason to use common node debugger instead of node-inspector? Commented Jun 6, 2014 at 10:52
  • I'm debugging protractor tests, if there is a way to do that with node-inspector I'd be happy to use that. Commented Jun 6, 2014 at 10:54
  • possible duplicate of Is there a Javascript variable that represents local scope? Like global? Commented Jun 6, 2014 at 10:57
  • @RuslanIsmagilov this is specifically in a debugging context, the other question is more generic, but they're related indeed. Commented Jun 6, 2014 at 11:00

1 Answer 1

5

no, currently it's not implemented in built in cli debugger. If you really need it I encourage you to try and add support yourself - the code is in /lib/_debugger.js and command is "scope". It's doable in less than 50 lines of code

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.