Skip to content

Commit

Permalink
adding support for passing opts to unlying phantom
Browse files Browse the repository at this point in the history
  • Loading branch information
jmervine committed Feb 20, 2016
1 parent 1e53ed1 commit 5890539
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions lib/yslow.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var path = require('path');
var Phapper = require('phapper');

function YSlow(url, args) {
function YSlow(url, args, opts) {
// mostly for test stub
if (!YSlow.prototype.script) {
this.script = require(path.join(__dirname, 'yspath')).yslowjs;
Expand All @@ -14,7 +14,11 @@ function YSlow(url, args) {
this.url = url || 'http://localhost';

args.push(this.url);
this.phantom = new Phapper(this.script, args);

opts = opts || {};
phantom_opts = opts.phantomjs || {};

this.phantom = new Phapper(this.script, args, phantom_opts);
}

YSlow.prototype = {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yslowjs",
"version": "0.3.2",
"version": "0.3.3",
"description": "Wrapper for phantomjs yslow.js",
"main": "./lib/yslow.js",
"license" : "MIT",
Expand Down

0 comments on commit 5890539

Please sign in to comment.