API reference
seniority/dotenv/cli
Every export of seniority/dotenv/cli, with its signature and doc comment: parseRunArgs, run, HELP, plus 2 types.
import { parseRunArgs, run, HELP } from 'seniority/dotenv/cli';Functions
parseRunArgs
dotenv's parseRunArgs.
function parseRunArgs(args: readonly string[]): RunArgs;| Parameter | Type |
|---|---|
args | readonly string[] |
Returns RunArgs
run
dotenv's run: the whole of dotenv <argv>.
function run(argv: readonly string[], proc?: CliProcess, io?: RunIo): void;| Parameter | Type |
|---|---|
argv | readonly string[] |
proc (optional) | CliProcess |
io (optional) | RunIo |
Returns void
Constants
HELP
dotenv's help text, to the line.
const HELP: string;Interfaces
RunIo
How the child is started, and how Windows takes its tree down; the real ones unless a test hands in its own.
interface RunIo {
spawn?: (command: string, args: readonly string[], options: SpawnOptions) => ChildProcess;
spawnSync?: (command: string, args: readonly string[], options: {
stdio: 'ignore';
}) => unknown;
}Types
RunArgs
The command line, read: dotenv's flags up to the command, and the command with everything after it.
type RunArgs = {
help: true;
} | {
error: string;
} | {
paths: string[];
pathSet: boolean;
quiet?: boolean;
debug?: boolean;
override?: boolean;
fast?: boolean;
command: string[];
};