@aws-sdk/shared-ini-file-loader

[![NPM version](https://img.shields.io/npm/v/@aws-sdk/shared-ini-file-loader/latest.svg)](https://www.npmjs.com/package/@aws-sdk/shared-ini-file-loader) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/shared-ini-file-loader.svg)](https://www.npmj

This package has moved to @smithy/shared-ini-file-loader
Last updated a year ago by aws-sdk-bot .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @aws-sdk/shared-ini-file-loader 
SYNC missed versions from official npm registry.

@aws-sdk/shared-ini-file-loader

NPM version NPM downloads

AWS Shared Configuration File Loader

This module provides a function that reads from AWS SDK configuration files and returns a promise that will resolve with a hash of the parsed contents of the AWS credentials file and of the AWS config file. Given the sample files below, the promise returned by loadSharedConfigFiles would resolve with:

{
  configFile: {
    'default': {
      aws_access_key_id: 'foo',
      aws_secret_access_key: 'bar',
    },
    dev: {
      aws_access_key_id: 'foo1',
      aws_secret_access_key: 'bar1',
    },
    prod: {
      aws_access_key_id: 'foo2',
      aws_secret_access_key: 'bar2',
    },
    'testing host': {
      aws_access_key_id: 'foo4',
      aws_secret_access_key: 'bar4',
    }
  },
  credentialsFile: {
    'default': {
      aws_access_key_id: 'foo',
      aws_secret_access_key: 'bar',
    },
    dev: {
      aws_access_key_id: 'foo1',
      aws_secret_access_key: 'bar1',
    },
    prod: {
      aws_access_key_id: 'foo2',
      aws_secret_access_key: 'bar2',
    }
  },
}

If a file is not found, its key (configFile or credentialsFile) will instead have a value of an empty object.

Supported configuration

You may customize how the files are loaded by providing an options hash to the loadSharedConfigFiles function. The following options are supported:

  • filepath - The path to the shared credentials file. If not specified, the provider will use the value in the AWS_SHARED_CREDENTIALS_FILE environment variable or a default of ~/.aws/credentials.
  • configFilepath - The path to the shared config file. If not specified, the provider will use the value in the AWS_CONFIG_FILE environment variable or a default of ~/.aws/config.
  • ignoreCache - The provider will normally cache the contents of the files it loads. This option will force the provider to reload the files from disk. Defaults to false.

Sample files

~/.aws/credentials

[default]
aws_access_key_id=foo
aws_secret_access_key=bar

[dev]
aws_access_key_id=foo2
aws_secret_access_key=bar2

[prod]
aws_access_key_id=foo3
aws_secret_access_key=bar3

~/.aws/config

[default]
aws_access_key_id=foo
aws_secret_access_key=bar

[profile dev]
aws_access_key_id=foo2
aws_secret_access_key=bar2

[profile prod]
aws_access_key_id=foo3
aws_secret_access_key=bar3

[profile "testing host"]
aws_access_key_id=foo4
aws_secret_access_key=bar4

Current Tags

  • 1.0.0-alpha.3                                ...           alpha (5 years ago)
  • 1.0.0-beta.4                                ...           beta (5 years ago)
  • 1.0.0-gamma.8                                ...           gamma (4 years ago)
  • 3.374.0                                ...           latest (a year ago)
  • 0.1.0-preview.3                                ...           preview (5 years ago)
  • 1.0.0-rc.9                                ...           rc (4 years ago)

111 Versions

  • 3.374.0 [deprecated]           ...           a year ago
  • 3.370.0                                ...           a year ago
  • 3.369.0                                ...           a year ago
  • 3.357.0                                ...           2 years ago
  • 3.354.0                                ...           2 years ago
  • 3.347.0                                ...           2 years ago
  • 3.342.0                                ...           2 years ago
  • 3.341.0                                ...           2 years ago
  • 3.338.0                                ...           2 years ago
  • 3.337.0                                ...           2 years ago
  • 3.329.0                                ...           2 years ago
  • 3.310.0                                ...           2 years ago
  • 3.306.0                                ...           2 years ago
  • 3.303.0                                ...           2 years ago
  • 3.300.0                                ...           2 years ago
  • 3.296.0                                ...           2 years ago
  • 3.295.0                                ...           2 years ago
  • 3.292.0                                ...           2 years ago
  • 3.290.0                                ...           2 years ago
  • 3.289.0                                ...           2 years ago
  • 3.287.0                                ...           2 years ago
  • 3.272.0                                ...           2 years ago
  • 3.271.0                                ...           2 years ago
  • 3.267.0                                ...           2 years ago
  • 3.266.1                                ...           2 years ago
  • 3.266.0                                ...           2 years ago
  • 3.257.0                                ...           2 years ago
  • 3.254.0                                ...           2 years ago
  • 3.226.0                                ...           2 years ago
  • 3.224.0                                ...           2 years ago
  • 3.222.0                                ...           2 years ago
  • 3.215.0                                ...           2 years ago
  • 3.212.0                                ...           2 years ago
  • 3.209.0                                ...           2 years ago
  • 3.208.0                                ...           2 years ago
  • 3.201.0                                ...           2 years ago
  • 3.200.0                                ...           2 years ago
  • 3.198.0                                ...           2 years ago
  • 3.197.0                                ...           2 years ago
  • 3.193.0                                ...           2 years ago
  • 3.190.0                                ...           2 years ago
  • 3.188.0                                ...           2 years ago
  • 3.186.0                                ...           2 years ago
  • 3.183.0                                ...           2 years ago
  • 3.178.0                                ...           2 years ago
  • 3.171.0                                ...           2 years ago
  • 3.170.0                                ...           2 years ago
  • 3.168.0                                ...           2 years ago
  • 3.162.0                                ...           2 years ago
  • 3.160.0                                ...           2 years ago
  • 3.159.0                                ...           2 years ago
  • 3.127.0                                ...           2 years ago
  • 3.110.0                                ...           3 years ago
  • 3.109.0                                ...           3 years ago
  • 3.80.0                                ...           3 years ago
  • 3.79.0                                ...           3 years ago
  • 3.78.0                                ...           3 years ago
  • 3.75.0                                ...           3 years ago
  • 3.58.0                                ...           3 years ago
  • 3.56.0                                ...           3 years ago
  • 3.55.0                                ...           3 years ago
  • 3.54.1                                ...           3 years ago
  • 3.52.0                                ...           3 years ago
  • 3.51.0                                ...           3 years ago
  • 3.49.0                                ...           3 years ago
  • 3.47.1                                ...           3 years ago
  • 3.47.0                                ...           3 years ago
  • 3.46.0                                ...           3 years ago
  • 3.37.0                                ...           3 years ago
  • 3.36.0                                ...           3 years ago
  • 3.35.0                                ...           3 years ago
  • 3.34.0                                ...           3 years ago
  • 3.32.0                                ...           3 years ago
  • 3.29.0                                ...           3 years ago
  • 3.23.0                                ...           3 years ago
  • 3.22.0                                ...           3 years ago
  • 3.20.0                                ...           3 years ago
  • 3.18.0                                ...           4 years ago
  • 3.13.1                                ...           4 years ago
  • 3.12.0                                ...           4 years ago
  • 3.10.0                                ...           4 years ago
  • 3.8.0                                ...           4 years ago
  • 3.7.0                                ...           4 years ago
  • 3.6.1                                ...           4 years ago
  • 3.4.1                                ...           4 years ago
  • 3.4.0                                ...           4 years ago
  • 3.1.0                                ...           4 years ago
  • 3.0.0                                ...           4 years ago
  • 1.0.0-rc.9                                ...           4 years ago
  • 1.0.0-rc.8                                ...           4 years ago
  • 1.0.0-rc.3                                ...           4 years ago
  • 1.0.0-rc.2                                ...           4 years ago
  • 1.0.0-rc.1                                ...           4 years ago
  • 1.0.0-gamma.8                                ...           4 years ago
  • 1.0.0-gamma.7                                ...           4 years ago
  • 1.0.0-gamma.6                                ...           4 years ago
  • 1.0.0-gamma.5                                ...           4 years ago
  • 1.0.0-gamma.4                                ...           4 years ago
  • 1.0.0-gamma.3                                ...           4 years ago
  • 1.0.0-gamma.2                                ...           4 years ago
  • 1.0.0-gamma.1                                ...           5 years ago
  • 1.0.0-beta.4                                ...           5 years ago
  • 1.0.0-beta.3                                ...           5 years ago
  • 1.0.0-beta.2                                ...           5 years ago
  • 1.0.0-beta.1                                ...           5 years ago
  • 1.0.0-alpha.3                                ...           5 years ago
  • 1.0.0-alpha.2                                ...           5 years ago
  • 1.0.0-alpha.1                                ...           5 years ago
  • 0.1.0-preview.3                                ...           5 years ago
  • 0.1.0-preview.2                                ...           5 years ago
  • 0.1.0-preview.1                                ...           6 years ago

© 2010 - cnpmjs.org x YWFE | Home | YWFE