Read env with default value
import { env } from 'read-env-value';
// read env 'NODE_ENV' with default value 'development'
const value = env('NODE_ENV', 'string', 'development');
key
: The environment variable key to read.type
: The type of the value to be returned.defaultValue
: The default value to return if the environment variable is not set.
- The value of the environment variable.
import { env } from 'read-env-value';
const value = env('NODE_ENV', 'string', 'development');
Made with contributors-img.