Browserify transform to fallback node.js basics in PhantomJS

npm install phantomjsify
3 downloads in the last month

phantomjsify Build status

Browserify transform to fallback node.js basics in PhantomJS

This was built to be able to run option parsers like commander inside of PhantomJS.

Getting Started

Install the module with: npm install phantomjsify

Use it as a transform with browserify:

# Currently, we require you to skip over PhantomJS exclusive require's (e.g. `system`)
browserify --standalone commander --entry node_modules/commander/index.js --transform phantomjsify --external system --outfile vendor/commander.js

Inside of your PhantomJS script, load in the browserified file:

var program = require('./vendor/commander')
console.log(program); // {"options":[{"flags":"-V, --version", ... "args":[]}


It is an aggressive venture to shim over all of [node][]'s functionality, especially across multiple versions. As a result, we are taking only what we need as we need it.

Pull requests are encouraged!

Shimmed this far


Support this project and others by twolfson via gittip.

Support via Gittip


In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint via grunt and test via npm test.


As of Nov 16 2013, Todd Wolfson has released this repository and its contents to the public domain.

It has been released under the UNLICENSE.

npm loves you