Skip to content
This repository has been archived by the owner on Jul 24, 2019. It is now read-only.

Integration in AWS Lambda service #704

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions lib/phantomjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
var fs = require('fs')
var path = require('path')
var spawn = require('child_process').spawn
var isLambda = require('is-lambda')
var phantomjsLambda = require('phantomjs-for-lambda')
var Promise = require('es6-promise').Promise


Expand All @@ -20,6 +22,12 @@ try {
exports.path = path.resolve(__dirname, location.location)
exports.platform = location.platform
exports.arch = location.arch

if(isLambda) {
exports.path = phantomjsLambda.path
exports.platform = "linux"
exports.arch = "x64"
}
} catch(e) {
// Must be running inside install script.
exports.path = null
Expand All @@ -32,6 +40,10 @@ try {
*/
exports.version = '2.1.1'

if(isLambda) {
exports.version = phantomjsLambda.version
}


/**
* Returns a clean path that helps avoid `which` finding bin files installed
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@
"extract-zip": "~1.5.0",
"fs-extra": "~1.0.0",
"hasha": "~2.2.0",
"is-lambda": "^1.0.0",
"kew": "~0.7.0",
"phantomjs-for-lambda": "^1.0.0",
"progress": "~1.1.8",
"request": "~2.79.0",
"request-progress": "~2.0.1",
Expand Down