Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vithalreddy/cloud-detect-js
Determine Host's cloud provider with a single command
https://github.com/vithalreddy/cloud-detect-js
alibabacloud aws azure digitalocean gcp nodejs oracle-cloud typescript
Last synced: 2 months ago
JSON representation
Determine Host's cloud provider with a single command
- Host: GitHub
- URL: https://github.com/vithalreddy/cloud-detect-js
- Owner: vithalreddy
- License: mit
- Created: 2019-08-28T12:26:28.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-07-13T22:30:04.000Z (over 4 years ago)
- Last Synced: 2024-11-15T23:10:42.027Z (3 months ago)
- Topics: alibabacloud, aws, azure, digitalocean, gcp, nodejs, oracle-cloud, typescript
- Language: TypeScript
- Homepage: https://github.com/vithalreddy/cloud-detect-js#usage-1
- Size: 27.3 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# cloud-detect-js
![License](https://img.shields.io/npm/l/cloud-detect-js?style=for-the-badge)
![Version](https://img.shields.io/npm/v/cloud-detect-js?style=for-the-badge)
![Dependencies](https://img.shields.io/david/vithalreddy/cloud-detect-js?style=for-the-badge)
![Issues](https://img.shields.io/github/issues/vithalreddy/cloud-detect-js?style=for-the-badge)
![Size](https://img.shields.io/bundlephobia/minzip/cloud-detect-js?style=for-the-badge)
![Node](https://img.shields.io/node/v/cloud-detect-js?style=for-the-badge)`cloud-detect-js` is a Node.JS module that determines a host's cloud provider. Highly inspired by the Go based [Satellite](https://github.com/banzaicloud/satellite), `cloud-detect-js` uses the same techniques (file systems and provider metadata) to properly identify cloud providers. Currently Supports AWS, GCP, Azure, Alibaba, Oracle, and Digital Ocean Cloud Providers.
## Installation
Via NPM:
```bash
npm install --save cloud-detect-js
```Via Yarn:
```bash
yarn add cloud-detect-js
```## Usage
```javascript
const { cloudProvider } = require('cloud-detect-js');(async () => {
await cloudProvider();
// wil return one of 'aws', 'gcp', 'azure', 'oracle', 'alibaba', 'do' or 'unknown'await cloudProvider();
// 'gcp'await cloudProvider(['aws', 'oracle']); //excluded
// 'unknown'
})();
```## CLI Usage
## Installation
Via NPM:
```bash
npm install -g cloud-detect-js
```Via Yarn:
```bash
yarn add global cloud-detect-js
```## Usage
```bash
Usage: cloud-detect-js [options] [command]Options:
-V, --version output the version number
-h, --help output usage informationCommands:
detect|d Detect's Host Machine's Cloud Providercloud-detect-js d
# awscloud-detect-js detect
# gcp
```