๐Ÿ“ฆ shieldfy / is-serverless

check if your code running inside a serverless function or not

โ˜… 5 stars โ‘‚ 4 forks ๐Ÿ‘ 5 watching โš–๏ธ MIT License
awsaws-lambdacloud-functionsgcpgcp-cloud-functionsserverless
๐Ÿ“ฅ Clone https://github.com/shieldfy/is-serverless.git
HTTPS git clone https://github.com/shieldfy/is-serverless.git
SSH git clone git@github.com:shieldfy/is-serverless.git
CLI gh repo clone shieldfy/is-serverless
Eslam Salem Eslam Salem Merge pull request #2 from WishAllVA/master f170b6a 3 years ago ๐Ÿ“ History
๐Ÿ“‚ master View all commits โ†’
๐Ÿ“ .github
๐Ÿ“ lib
๐Ÿ“ test
๐Ÿ“„ .gitignore
๐Ÿ“„ index.js
๐Ÿ“„ LICENSE
๐Ÿ“„ package-lock.json
๐Ÿ“„ package.json
๐Ÿ“„ README.md
๐Ÿ“„ README.md

is-serverless

Detection library for serverless environment, currently supports (AWS Lambda, GCP cloud functions, Azure functions, Cloudflare workers)

Inspiration

This package inspired by is-lambda package by @watson

Installation

npm install is-serverless

Usage

var isServerless = require('is-serverless')

if (isServerless.result) {
  console.log('The code is running on a serverless environment : ' + isServerless.whichOne)
}

Contribution

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.

License

MIT