node.js - Can you use Node Inspector with the .coffee handler? -
debugging node apps using node-inspector pretty simple if you're scripting using javascript or compiled coffee (coffee -c -m script.coffee).
however, when using coffeescript require handler:
require('coffee-script/register'); require('lib/component.coffee'); in script i'm trying debug using node-debug, get:
(function (exports, require, module, __filename, __dirname) { # ^ syntaxerror: unexpected token illegal @ module._compile (module.js:439:25) @ object.module._extensions..js (module.js:474:10) @ module.load (module.js:356:32) @ function.module._load (module.js:312:12) @ module.require (module.js:364:17) @ require (module.js:380:17) ... right require file.
is i'm trying possible? have several coffeescript files rather not have compile each time want test.
yes, definitely. use time, command line looks these:
node-inspector & coffee --nodejs --debug-brk ./scripts/mongoetl.coffee node-inspector & mocha --compilers coffee:coffee-script ./test/datalayer-test.coffee --ui bdd --debug-brk node-inspector --web-port=5870 & mocha --compilers coffee:coffee-script/register ./test/datalayer-test.coffee --ui bdd --debug-brk=5880 -g 'my test name here' i checked last line, it's working , has coffeescript requires in it. when i'm debugging i'm seeing javascript, not coffee. don't know if it's possible run , debug coffeescript node-inspector (edit: yes, is, use of source maps required out of scope answer). i'm not convinced has value -- think it's able read javascript well, haven't looked it.
i think issue might in compilation, have tried compiling file that's being required?
Comments
Post a Comment