Skip to content
Determine Host's cloud provider with a single command
TypeScript JavaScript
Branch: master
Clone or download
Latest commit 438ca38 Sep 5, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Initial Commit Aug 30, 2019
bin cli alias added Sep 5, 2019
examples added example Aug 30, 2019
src use simple debug logger fn Sep 5, 2019
.editorconfig Initial Commit Aug 30, 2019
.gitignore Initial Commit Aug 30, 2019
.npmignore added example Aug 30, 2019
CHANGELOG.md chore(release): 1.0.12 Sep 5, 2019
LICENSE Initial Commit Aug 30, 2019
README.md fix typo Sep 5, 2019
package.json chore(release): 1.0.12 Sep 5, 2019
tsconfig.json Initial Commit Aug 30, 2019
tslint.json Initial Commit Aug 30, 2019

README.md

cloud-detect-js

License Version Dependencies Issues Size Node

cloud-detect-js is a Node.JS module that determines a host's cloud provider. Highly inspired by the Go based 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:

npm install --save cloud-detect-js

Via Yarn:

yarn add cloud-detect-js

Usage

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:

npm install -g cloud-detect-js

Via Yarn:

yarn add global cloud-detect-js

Usage

Usage: cloud-detect-js [options] [command]

Options:
  -V, --version  output the version number
  -h, --help     output usage information

Commands:
  detect|d       Detect's Host Machine's Cloud Provider

cloud-detect-js d
# aws

cloud-detect-js detect
# gcp
You can’t perform that action at this time.