alexscheelmeyer/node-phantom — pull request #19 by darwalenator (2012-12-05 14:46:26+00:00)
Title: Custom Path for PhantomJS

Hi there. I must admit I'm new to this so I hope I'm not breaking any etiquette by requesting this fork.

Anyhoo, I've found this package hugely useful. It's so much nicer to work with Phantom this way.

We have a mixed development environment with a bunch of developers on either Windows or OSX and a continual build environment (TeamCity) hosted on an Amazon EC2 Ubuntu box. like I say - mixed.

Given the range of environments I need to support, I want to use the [PhantomJS package](https://npmjs.org/package/phantomjs) to make sure each dev, and the build server, has the PhantomJS binary available. This will put the Phantom binary in their node_modules path.

In order to support this, and still make use of node-phantom, I needed the option to use a custom path for Phantom.

My usual code preference is coffee-script. And when invoking node-phantom with coffee-script, the extra, optional parameter is easy to add, and to read. Something like:

```coffee
node-phantom.create (err, ph)->
ph.createPage (err, page)->
# do stuff to the page
,"path/to/phantom"
```

I think (hope) others may find this useful. Especially when dealing with such a mixed team of developers.

Here's the confession - > I haven't written any tests for this. At least not in this project. I've tested the hell out of it in my implementation. But it's a pretty innocuous change in the code. One line really. So hopefully you'll include it?

Thanks in advance