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

@adobe/aio-cli-config

Package Overview
Dependencies
Maintainers
41
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@adobe/aio-cli-config

Adobe I/O configuration module for the AIO CLI

  • 1.0.12
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
219
increased by68.46%
Maintainers
41
Weekly downloads
 
Created
Source

aio-cli-config

oclif Version Downloads/week Build Status License Greenkeeper badge Codecov Coverage

This is a nodejs module to allow management of persistant and environment variable configuration by aio-cli plugins.

The module can be added to your project with:

> yarn add aio-cli-config

or

> npm install aio-cli-config --save

Here is a snippet:

const config = require('aio-cli-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')

Peristent File Locations

User Configuration

The user default location is:

  1. ENV['AIO_CONFIG_FILE']
  2. ENV['XDG_CONFIG_HOME']/aio
  3. <HOME>/.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

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_<PLUGIN>_<KEY>
$ 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

Contributing

Contributions are welcomed! Read the Contributing Guide for more information.

Licensing

This project is licensed under the Apache V2 License. See LICENSE for more information.

FAQs

Package last updated on 25 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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