The last post I wrote about this was in November 2011 (!!!). But I started putting code together only in Jan 2012. So, overall, from the first commit until today is almost 2 months.
First thing first: how do you get to try it? Well, you can get my fork, switch to the
dev-repl branch and try it out:
$ git clone git://github.com/detro/phantomjs.git $ cd phantomjs $ git checkout -b dev-repl origin/dev-repl $ qmake && make
To launch it, just type:
$ ./bin/phantomjs >
The REPL is packed with some good features that I'm sure will please command-line junkies:
- Context-sensitive auto-completions (i.e. push on
TABto cycle through suggestions)
- Arrow navigation through the history of what you type
- Permanent history (yes, like any "modern" CLI)
- Editable command line (use
Rightto insert characters where you need them)
- Pretty-print of expression result (great to quickly recall the name of a method)
It's not part of the latest PhantomJS, but I plan to file a pull request very soon.
Please, help yourself to it and share your view and feedback. I did this work specifically to make PhantomJS users happy: so, help me make you happy :)