Detection library for serverless environment, currently supports (AWS Lambda, GCP cloud functions, Azure functions, Cloudflare workers)
This package inspired by is-lambda package by @watson
npm install is-serverless
varisServerless=require('is-serverless')if(isServerless.result){console.log('The code is running on a serverless environment : '+isServerless.whichOne)}Feel free to fork, commit and submit pull request if you find a bug, or you want to add support to a new environment. Contributions are very welcome.
MIT