Skip to content

twolfson/phantomjsify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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')
                .parse(process.argv);
console.log(program); // {"options":[{"flags":"-V, --version", ... "args":[]}

Documentation

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

Donating

Support this project and others by twolfson via gittip.

Support via Gittip

Contributing

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.

Unlicense

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.

About

Browserify transform to fallback node.js basics in PhantomJS

Resources

License

Stars

Watchers

Forks

Packages

No packages published