https://github.com/shieldfy/is-serverless
check if your code running inside a serverless function or not
https://github.com/shieldfy/is-serverless
aws aws-lambda cloud-functions gcp gcp-cloud-functions serverless
Last synced: 8 months ago
JSON representation
check if your code running inside a serverless function or not
- Host: GitHub
- URL: https://github.com/shieldfy/is-serverless
- Owner: shieldfy
- License: mit
- Created: 2019-08-29T08:38:25.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-11-30T09:35:09.000Z (over 3 years ago)
- Last Synced: 2024-11-01T02:35:59.690Z (over 1 year ago)
- Topics: aws, aws-lambda, cloud-functions, gcp, gcp-cloud-functions, serverless
- Language: JavaScript
- Size: 9.77 KB
- Stars: 5
- Watchers: 4
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# is-serverless
Detection library for serverless environment, currently supports ([AWS Lambda](https://aws.amazon.com/lambda/), [GCP cloud functions](https://cloud.google.com/functions/), [Azure functions](https://azure.microsoft.com/en-in/services/functions/), [Cloudflare workers](https://workers.cloudflare.com))
## Inspiration
This package inspired by `is-lambda` package by [@watson](https://github.com/watson)
## Installation
```
npm install is-serverless
```
## Usage
```js
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