News for hackers. Stuff that matters.
Re:Pseudosynchronous JavaScript by impostervt on Thursday June 25, 2015 @08:45AM (#9777446)
I worked in a similar vein with Horseman:

http://horsemanjs.org/

The library runs PhantomJS. While there are many libraries that do this, I wanted a synchronous, chainable API. So I could do

var links = horseman.count('a'); if (count > 3) { horseman.open('http://www.google.com') } else { horseman.open('http://www.yahoo.com') }

Under the hood, using the library literally blocks. Which is a very, very un-javascript/Node thing to do, and introduces other weirdness, I know.

There are no comments on this comment yet.