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

@adobe/aio-lib-env

Package Overview
Dependencies
Maintainers
22
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@adobe/aio-lib-env

Adobe I/O lib for determining dev environment

  • 2.0.0-pre.2024-01-08.afe0f46e
  • next
  • Source
  • npm
  • Socket score

Version published
Maintainers
22
Created
Source

Version Downloads/week Node.js CI License Codecov Coverage

Adobe I/O Env Lib

This is a helper library that is to be used in the Adobe I/O CLI and SDKs to determine the environment to run in, whether prod, or stage.

Installing

$ npm install @adobe/aio-lib-env 

Usage

Determining the Environment

const { 
  getCliEnv, /* function */ 
  setCliEnv, /* function */
  SUPPORTED_ENVS, /* array<string> */
  DEFAULT_ENV, /* string */
  PROD_ENV, /* string */
  STAGE_ENV /* string */
} = require('@adobe/aio-lib-env')

// getCliEnv defaults to PROD_ENV if the global config key is not set, or is set to an unknown env
const env = getCliEnv() 
// do something based on the env - switch to prod or stage endpoints, for example

Setting the Environment (.aio)

{
  cli: {
    env: "prod"
  }
}

Setting the Environment (.env)

AIO_CLI_ENV=prod

Setting the Environment (in code)

const { setCliEnv, PROD_ENV, STAGE_ENV } = require('@adobe/aio-lib-env')

setCliEnv(PROD_ENV)
setCliEnv(STAGE_ENV)
setCliEnv('delta-quadrant') // throws Error

Debug Logs

LOG_LEVEL=debug <your_call_here>

Prepend the LOG_LEVEL environment variable and debug value to the call that invokes your function, on the command line. This should output a lot of debug data for your SDK calls.

Contributing

Contributions are welcome! 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 08 Jan 2024

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