Execute a script in phantomjs interactive (REPL) mode [duplicate]

馋奶兔 提交于 2020-01-10 04:23:04

问题


I have a file that runs and prints output to the screen when I run it in phantomjs non-interactive mode

$ phantomjs file.js
<stuff printed to screen>

In phantonjs interactive (REPL) mode is there a way to run a js file, something like run('file.js'). I want to open up phantomjs as a pipe and send it multiple files to execute before closing the pipe to save on startup overhead.


回答1:


Looks like REPL mode is borked and and an overhaul is underway:

https://github.com/ariya/phantomjs/issues/11180



来源:https://stackoverflow.com/questions/17708657/execute-a-script-in-phantomjs-interactive-repl-mode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!