Adobe I/O lib for determining dev environment
npm install @adobe/aio-lib-env

!Node.js CI


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.
``bash`
$ npm install @adobe/aio-lib-env
Determining the Environment
`javascript
const {
getCliEnv, / function /
setCliEnv, / function /
SUPPORTED_ENVS, / array
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)
`json`
{
cli: {
env: "prod"
}
}
Setting the Environment (.env)
`ini`
AIO_CLI_ENV=prod
Setting the Environment (in code)
`javascript
const { setCliEnv, PROD_ENV, STAGE_ENV } = require('@adobe/aio-lib-env')
setCliEnv(PROD_ENV)
setCliEnv(STAGE_ENV)
setCliEnv('delta-quadrant') // throws Error
`
`bash`
LOG_LEVEL=debug
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.
Contributions are welcome! Read the Contributing Guide for more information.
This project is licensed under the Apache V2 License. See LICENSE for more information.