You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 14, 2020. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,9 @@
1
1
# joytocode/lighthouse-lambda
2
+
2
3
Run [Google Chrome Lighthouse](https://github.com/GoogleChrome/lighthouse) on [AWS Lambda](https://aws.amazon.com/lambda/).
3
4
4
5
## Versions
6
+
5
7
Since version 2.x, `lighthouse-lambda` has the same major version of [lighthouse](https://www.npmjs.com/package/lighthouse). For example, `lighthouse-lambda` 3.x will use `lighthouse` 3.x.
6
8
7
9
This README is for version 3.x. To see older versions, visit:
@@ -14,8 +16,6 @@ This README is for version 3.x. To see older versions, visit:
14
16
$ npm install lighthouse-lambda --save
15
17
```
16
18
17
-
The postinstall script of `lighthouse-lambda` will download a Headless Chrome binary if it does not already exist. The binary is from [joytocode/headless-chrome-builder](https://github.com/joytocode/headless-chrome-builder) and is tested to make sure it works with Lighthouse.
$ docker run --rm -v "$PWD":/var/task lambci/lambda:build-nodejs8.10 bash -c "rm -f *.zip && zip lambda.zip -r node_modules index.js package.json"
61
61
```
62
62
63
-
- The file will be big (at least 80MB), so you need to upload it to S3 then deploy to Lambda from S3.
63
+
- The file will be big (at least 75MB), so you need to upload it to S3 then deploy to Lambda from S3.
64
64
- You should allocate at least 512 MB memory and 15 seconds timeout to the function.
65
65
66
66
## API
@@ -71,10 +71,14 @@ Same parameters as [Using Lighthouse programmatically](https://github.com/Google
71
71
72
72
Returns a `Promise` of an Object with the following fields:
73
73
74
-
-`chrome`: an instance of [`chromeLauncher.launch()`](https://github.com/GoogleChrome/chrome-launcher#launchopts).
74
+
-`chrome`: an instance of [`chromeLauncher.launch()`](https://github.com/GoogleChrome/chrome-launcher#launchopts), remember to call `chrome.kill()` in the end.
75
75
-`log`: an instance of [lighthouse-logger](https://github.com/GoogleChrome/lighthouse/tree/master/lighthouse-logger) (only if you set `options.logLevel`).
76
76
-`start()`: a function to start the scan which returns a `Promise` of Lighthouse results.
77
77
78
+
## Credits
79
+
80
+
`lighthouse-lambda` uses the Headless Chrome binary (stable version) from [@serverless-chrome/lambda](https://www.npmjs.com/package/@serverless-chrome/lambda).
0 commit comments