alixaxel / chrome-aws-lambda

Chromium Binary for AWS Lambda and Google Cloud Functions
MIT License
3.22k stars 293 forks source link

Use in custom Node runtimes #268

Open dougmoscrop opened 2 years ago

dougmoscrop commented 2 years ago

What would you like to have implemented?

Running Node 16 in a Custom Runtime on Lambda, requires this workarond:

process.env.AWS_EXECUTION_ENV = 'AWS_Lambda_nodejs14.x'
const { default: chromium } = await import('chrome-aws-lambda')

Given the deprecation of older Lambda runtimes, perhaps the check could just be if AWS_EXECUTION_ENV starts with AWS_Lambda_?