{"id":15629279,"url":"https://github.com/rafalwilinski/serverless-puppeteer-layers","last_synced_at":"2025-04-09T16:20:34.364Z","repository":{"id":50066885,"uuid":"159799172","full_name":"RafalWilinski/serverless-puppeteer-layers","owner":"RafalWilinski","description":"Serverless Framework + AWS Lambda Layers + Puppeteer = ❤️","archived":false,"fork":false,"pushed_at":"2021-06-05T03:51:46.000Z","size":84826,"stargazers_count":273,"open_issues_count":6,"forks_count":36,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-02T10:46:30.188Z","etag":null,"topics":["aws-lambda","chrome","headless","layers","puppeteer","serverless"],"latest_commit_sha":null,"homepage":"https://dynobase.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RafalWilinski.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-30T09:22:33.000Z","updated_at":"2025-02-18T03:08:34.000Z","dependencies_parsed_at":"2022-09-25T08:02:23.183Z","dependency_job_id":null,"html_url":"https://github.com/RafalWilinski/serverless-puppeteer-layers","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RafalWilinski%2Fserverless-puppeteer-layers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RafalWilinski%2Fserverless-puppeteer-layers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RafalWilinski%2Fserverless-puppeteer-layers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RafalWilinski%2Fserverless-puppeteer-layers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RafalWilinski","download_url":"https://codeload.github.com/RafalWilinski/serverless-puppeteer-layers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248065281,"owners_count":21041872,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws-lambda","chrome","headless","layers","puppeteer","serverless"],"created_at":"2024-10-03T10:26:30.124Z","updated_at":"2025-04-09T16:20:34.331Z","avatar_url":"https://github.com/RafalWilinski.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Serverless Puppeteer using AWS Lambda Layers\n\n\u003cp\u003e\n  \u003cimg src=\"https://img.shields.io/badge/version-1.1.0-blue.svg?cacheSeconds=2592000\" /\u003e\n  \u003ca href=\"https://twitter.com/rafalwilinski\"\u003e\n    \u003cimg alt=\"Twitter: rafalwilinski\" src=\"https://img.shields.io/twitter/follow/rafalwilinski.svg?style=social\" target=\"_blank\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003e Recently AWS introduced [Layers](https://aws.amazon.com/about-aws/whats-new/2018/11/aws-lambda-now-supports-custom-runtimes-and-layers/) which enables sharing common code between functions and working with large dependencies (such as headless chrome) much easier.\n\nThis project example returns a screenshot of page requested via `?address=` query parameter.\n\n![Demo](assets/demo.gif?raw=true 'Demo')\n\n### Usage\n\nIt is very important to tell NPM to skip installing chromium from `puppeteer` package. To do so, installing dependencies should be done using this command:\n\n```sh\nPUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 npm install\n```\n\nor\n\n```sh\nPUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 yarn\n```\n\nWithout this, your function size would be more than 200MB which is way too much.\n\nAfter that, you can simply deploy your funciton.\n\n```sh\nsls deploy\n\ncurl \u003cDEPLOYED_ENDPOINT\u003e?address=https://google.com\n```\n\nor apply this ARN to your function directly: `arn:aws:lambda:us-east-1:085108115628:layer:chrome:6`\n\n### Bundling latest Chromium on your own\n\nPrerequisites:\n\n- `brotli`\n\n```sh\n./download-latest.sh\n```\n\nCredits for this solution go to [San Kumar](https://github.com/san-kumar)\n\n### Author\n\n👤 **Rafal Wilinski**\n\n- Twitter: [@rafalwilinski](https://twitter.com/rafalwilinski)\n- Github: [@RafalWilinski](https://github.com/RafalWilinski)\n\n### Show your support\n\nGive a ⭐️ if this project helped you!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafalwilinski%2Fserverless-puppeteer-layers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frafalwilinski%2Fserverless-puppeteer-layers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafalwilinski%2Fserverless-puppeteer-layers/lists"}