WebStorm -> how to execute JavaScript in PhantomJS?
Hi,
I want to excute my JavaScript with PhantomJS, but I can't figure out how to configure that.
I also didn't find a plugin for running .js files in PhantomJS.
So my question is easy: How do I configure WebStorm to execute certain .js files in PhantomJS?
(This is currently for mac, but that should work on Win too).
Regards,
Sebastian
Please sign in to leave a comment.
Hi Sebastian,


I would suggest you to set up an external tool:
Done that, just trigger main menu action (you can assign keyboard shortcut to it) and it will execute the file in the active editor tab:
Regards,
Kirill
Works like a charm. Thank you :)
Wow. That's great ! Thank you Kirill Safonov :) !
Hey, I need some help.
My windows user account has a whitespace in it's name. Webstorm gives me the following error: "Can't open 'C:\Users\Name'
How do I solve this problem?
Thanks in advance.
Is it about external tools? what does the tool definition look like? Please attach a screenshot
Yes, it is the same tool (PhantomJS)
Results in:
1. don't add quotes around Program: path - WebStorm will take care of it
2. as you are using $FileDir$ as a working directory, you can just use $FileName$ as Arguments:; but, if you like to pass a full path, use "$FileDir$/$FileName$" (in quotes)
Thanks for your help. Now it works :)