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 StartedInstall 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 farSupport this project and others by twolfson via gittip.
ContributingIn 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.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4