2.0.1 • Published 3 years ago

aws-has-region v2.0.1

Weekly downloads
40
License
MIT
Repository
github
Last release
3 years ago

AWS has region

Check wether or not the aws-sdk has a configured region, without loading any clients into memory.

Installation

npm install --save aws-has-region

Usage

import awsHasRegion, { errorText } from 'aws-has-region'

if (!(await awsHasRegion())) {
  console.error(errorText)
  process.exit(1)
}

// ...

API

awsHasRegion()

  • returns Promise<boolean>

Returns true if the AWS SDK region config is set, otherwise false.

errorText

  • type: string

A error message that can be printed if the region is not set.