Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aws-sdk-config-loader

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws-sdk-config-loader - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

19

lib/index.js

@@ -14,5 +14,9 @@ 'use strict';

/**
* return region string load from config file or environment variables.
*
* @param {Object} AWS AWS SDK module
* @return {string|undefined}
*/
function regionProvider(AWS) {
var filename = process.env.AWS_CONFIG_FILE || _path2['default'].join(process.env.HOME, '.aws', 'config');
var profile = process.env.AWS_PROFILE || 'default';
var region = process.env.AWS_REGION || process.env.AMAZON_REGION;

@@ -22,3 +26,8 @@ if (region) {

}
var filename = process.env.AWS_CONFIG_FILE || process.env.HOME && _path2['default'].join(process.env.HOME, '.aws', 'config');
if (!filename) {
return region;
}
try {
var profile = process.env.AWS_PROFILE || 'default';
var configs = AWS.util.ini.parse(AWS.util.readFileSync(filename));

@@ -33,2 +42,8 @@ if (typeof configs[profile] === 'object') {

/**
* initialize AWS.config using regionProvider
*
* @param {Object} AWS AWS SDK module
*/
function loader(AWS) {

@@ -35,0 +50,0 @@ AWS.util.update(AWS.Config.prototype.keys, {

3

package.json
{
"name": "aws-sdk-config-loader",
"version": "0.1.1",
"version": "0.1.2",
"description": "AWS config file loader for CLI tools",

@@ -36,2 +36,3 @@ "author": "moqada <moqada@gmail.com>",

"build": "rm -r lib && babel src --out-dir lib",
"publish": "npm run build && npm publish",
"test": "eslint src && babel-node $(npm bin)/isparta cover --report text --report html $(npm bin)/_mocha -- --require test/hook test/*spec.js",

@@ -38,0 +39,0 @@ "testing": "mocha --require test/hook --watch test/*spec.js"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc