# aio-lib-core-config **Repository Path**: mirrors_adobe/aio-lib-core-config ## Basic Information - **Project Name**: aio-lib-core-config - **Description**: Configuration module for use by the Adobe I/O SDK - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-09-24 - **Last Updated**: 2026-03-21 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README @adobe/aio-lib-core-config ======================= [![Version](https://img.shields.io/npm/v/@adobe/aio-lib-core-config.svg)](https://npmjs.org/package/@adobe/aio-lib-core-config) [![Downloads/week](https://img.shields.io/npm/dw/@adobe/aio-lib-core-config.svg)](https://npmjs.org/package/@adobe/aio-lib-core-config) ![Node.js CI](https://github.com/adobe/aio-lib-core-config/workflows/Node.js%20CI/badge.svg) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Codecov Coverage](https://img.shields.io/codecov/c/github/adobe/aio-lib-core-config/master.svg?style=flat-square)](https://codecov.io/gh/adobe/aio-lib-core-config/) [![Size(minified)](https://badgen.net/bundlephobia/min/@adobe/aio-lib-core-config)](https://npmjs.org/package/@adobe/aio-lib-core-config) This is a nodejs module to allow management of persistent and environment variable configuration. The module can be added to your project with: ```javascript npm install @adobe/aio-lib-core-config --save ``` Here is a snippet: ```javascript const config = require('@adobe/aio-lib-core-config') // set a key value config.set('pgb.authtoken', 1234) // reload data from files and environmental variables config.reload() // get all stored data config.get() // get data from a given key config.get('pgb.authtoken') // delete a key config.delete('pgb.authtoken') ``` ## Persistent File Locations ### User Configuration The user default location is: 1. **ENV['AIO_CONFIG_FILE']** 1. **ENV['XDG_CONFIG_HOME']/aio** 1. **\/.config/aio** depending on whether the specified environmental variables exist ### Project Configuration Local configuration is loaded from **$PWD/.aio** ### Dot Env Configuration A local .env file is also loaded. This file can contain environmental variables. Note: All environment variable names will be converted to uppercase. 1. In the event that there are duplicate environment variables, if the uppercase version exists, it will be hoisted. ``` aa=1 aA=2 AA=3 <-- Hoisted as AA ``` 2. In the event that there are duplicate environment variables with multiple case variations, the first entry will be hoisted. ``` aa=1 <-- Hoisted as AA Aa=2 ``` ## Resolving Values Resolving configuration is done in two steps: 1. .env file is read, parsed and hoisted to environment variables ( process.env ) 2. user and local files are read Inheritance is similar to NPMRC and can be set using user file, project file and matching environment variables. Values are read and merged in the following order in increasing priority: 1. user config eg. ~/.config/aio 2. project config eg. $PWD/.aio 3. environment variables matching AIO_\_\ ```bash $ AIO_PGB_AUTHTOKEN=1234 node > config.get('pgb.authtoken') 1234 $ AIO_PGB_AUTH__TOKEN=1234 node # use double underscores to specify an underscore > config.get('pgb.auth_token') 1234 ``` ## Explore `goto` [API](./doc/api.md) ## Contributing Contributions are welcomed! Read the [Contributing Guide](./.github/CONTRIBUTING.md) for more information. ## Licensing This project is licensed under the Apache V2 License. See [LICENSE](LICENSE) for more information.