env-cmd
- Version 10.1.0
- Published
- 46.1 kB
- 2 dependencies
- MIT license
Install
npm i env-cmd
yarn add env-cmd
pnpm add env-cmd
Overview
Executes a command using the environment variables in an env file
Index
Variables
Functions
Interfaces
Variables
variable GetEnvVars
const GetEnvVars: (options?: GetEnvVarOptions) => Promise<{ [key: string]: any }>;
Functions
function CLI
CLI: (args: string[]) => Promise<{ [key: string]: any }>;
Executes env - cmd using command line arguments
Parameter args
Command line argument to pass in ['-f', './.env']
Returns
{Promise<{ [key: string]: any }>}
function EnvCmd
EnvCmd: ({ command, commandArgs, envFile, rc, options,}: EnvCmdOptions) => Promise<{ [key: string]: any }>;
The main env-cmd program. This will spawn a new process and run the given command using various environment file solutions.
Parameter
{EnvCmdOptions} { command, commandArgs, envFile, rc, options }
Returns
{Promise<{ [key: string]: any }>} Returns an object containing [environment variable name]: value
Interfaces
interface EnvCmdOptions
interface EnvCmdOptions extends Pick<GetEnvVarOptions, 'envFile' | 'rc'> {}
property command
command: string;
property commandArgs
commandArgs: string[];
property options
options?: { expandEnvs?: boolean; noOverride?: boolean; silent?: boolean; useShell?: boolean; verbose?: boolean;};
interface GetEnvVarOptions
interface GetEnvVarOptions {}
Package Files (3)
Dependencies (2)
Dev Dependencies (13)
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/env-cmd
.
- Markdown[](https://www.jsdocs.io/package/env-cmd)
- HTML<a href="https://www.jsdocs.io/package/env-cmd"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 1020 ms. - Missing or incorrect documentation? Open an issue for this package.