Dav Glass is someone who you should make it a point to meet someday. Down-to-earth, smiling, and brilliant. One of the things I really find impressive is his ability to take your assumptions about tech and toss them out the door and show you how much cooler things could be.
One of his recent projects is something called YUI-REPL. Essentially this is a command-line instance of YUI that you can use to test code, debug issues, and try out lots of interesting features of YUI without having to deal with a browser or having a page hosted somewhere. In order to try this out, you need to get node.js working as well as npm. Node.js is essentially a “server side” version of a javascript runtime that can load documents, do complex tasks, and lots of things outside the scope of this post. Suffice to say, if you have not been reading about Node.js you need to spend the weekend getting up to speed. NPM is a package manager that allows you to load cool utilities and features that Node.js uses and can take care of all the dependancies each of those utilities may need in order to run.
YUI-REPL is very similar to the REPL in node.js. You launch it via calling “yui3″ and you now have an interactive command line that lets you load in websites, load in YUI javascript code, call other YUI modules into your code via “use” statements, and all kinds of other interesting things. For instance here is a call to YQL that I created in my previous post — it works flawlessly here and actually represtents another use case for this REPL — debugging your web services. Mind blown yet?
Here is a snippet from @davglass that highlights the load feature of YUI-REPL:
Which loads this script:
And here is a screencast of YUI-REPL in action.
In terms of what sort of future YUI-REPL will have, I have heard that there may be plans to fold it back into the core YUI library somehow – so that you’ll be able to use it anytime as well as having more developers taking a look at the code and adding new features. One in particular may be to allow you to pipe info into and out of the app like any other UNIX command – so you could imagine writing some interesting shell scripts or QA testing of your site via a single command line.
I encourage you to go grab a copy yourself and check it out!
