Skip to content
This repository was archived by the owner on Mar 14, 2020. It is now read-only.

Commit 1ac9464

Browse files
authored
feat: use Chrome binary from joytocode (#3)
1 parent f6420cb commit 1ac9464

5 files changed

Lines changed: 3451 additions & 23 deletions

File tree

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2018-current WebOK <team@webok.io> and other contributors
3+
Copyright (c) 2018-current JoyToCode <team@joytocode.com> and other contributors
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# lighthouse-lambda
2-
> Run [Google Chrome Lighthouse](https://github.com/GoogleChrome/lighthouse) on [AWS Lambda](https://aws.amazon.com/lambda/)
1+
# joytocode/lighthouse-lambda
2+
Run [Google Chrome Lighthouse](https://github.com/GoogleChrome/lighthouse) on [AWS Lambda](https://aws.amazon.com/lambda/).
33

44
## Installation
55

6-
```
6+
```bash
77
$ npm install lighthouse-lambda --save
88
```
99

10-
The postinstall script of `lighthouse-lambda` will download a headless chrome binary if it does not already exist. The binary is from [serverless-chrome](https://github.com/adieuadieu/serverless-chrome) and is tested to make sure it works with Lighthouse.
10+
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.
1111

1212
## Lambda function
1313

@@ -34,21 +34,21 @@ exports.handler = function (event, context, callback) {
3434

3535
You can use [docker-lambda](https://github.com/lambci/docker-lambda) to test your Lambda function locally.
3636

37-
```
38-
$ docker run --rm -v "$PWD":/var/task lambci/lambda:nodejs6.10 index.handler
37+
```bash
38+
$ docker run --rm -v "$PWD":/var/task lambci/lambda:nodejs8.10 index.handler
3939
```
4040

4141
## Deployment
4242

4343
You can use [docker-lambda](https://github.com/lambci/docker-lambda) to install dependencies and pack your Lambda function.
4444

45-
```
46-
$ docker run --rm -v "$PWD":/var/task lambci/lambda:build-nodejs6.10 bash -c "rm -rf node_modules && npm install"
45+
```bash
46+
$ docker run --rm -v "$PWD":/var/task lambci/lambda:build-nodejs8.10 bash -c "rm -rf node_modules && npm install"
4747

48-
$ docker run --rm -v "$PWD":/var/task lambci/lambda:build-nodejs6.10 bash -c "rm -f *.zip && zip lambda.zip -r node_modules index.js package.json"
48+
$ 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"
4949
```
5050

51-
- The file will be big (at least 75MB), so you need to upload it to S3 before deploying to Lambda from S3.
51+
- The file will be big (at least 80MB), so you need to upload it to S3 then deploy to Lambda from S3.
5252
- You should allocate at least 512 MB memory and 15 seconds timeout to the function.
5353

5454
## API

lib/chromeConfig.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ exports.binary = {
66
binPath: binPath,
77
cachePath: getCachePath(),
88
fileName: 'headless-chromium',
9-
version: 'stable-64.0.3282.186',
9+
version: '66.0.3359.117',
1010
checksum: {
1111
algorithm: 'sha256',
12-
value: 'd29ae3059e9a235241b4c14a246c353a2d1afcd5a8abbf4867d81a7b9dde10f0'
12+
value: 'd2f28503a1a96d641a1079a93064752f75abf6ddf1c3750ea44251a16aed6736'
1313
}
1414
}
1515

0 commit comments

Comments
 (0)