Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ndeno/src/deps.ts>Command#env

Command line tool created by deno to manage node projects | deno 实现的 node 项目包管理命令工具
Go to Latest
method Command.prototype.env
Re-export
import { Command } from "https://deno.land/x/ndeno@v1.3.1/src/deps.ts";

Add new environment variable.

Type Parameters

N extends string
G extends TypedEnv<N, P, TCommandOptions, Merge<TParentCommandTypes, Merge<TCommandGlobalTypes, TCommandTypes>>, R>
MG extends MapValue<G, V>
optional
R extends EnvVarOptions["required"] = undefined
optional
P extends EnvVarOptions["prefix"] = undefined
optional
V = undefined

Parameters

name: N

Name of the environment variable.

description: string

The description of the environment variable.

options: Omit<EnvVarOptions, "value"> & { global: true; required?: R; prefix?: P; value?: EnvVarValueHandler<MapTypes<ValueOf<G>>, V>; }

Environment variable options.

Returns

Command<TParentCommandGlobals, TParentCommandTypes, TCommandOptions, TCommandArguments, Merge<TCommandGlobals, MG>, TCommandTypes, TCommandGlobalTypes, TParentCommand>

Type Parameters

TNameAndValue extends string
TEnvVar extends TypedEnv<TNameAndValue, TPrefix, TCommandOptions, Merge<TParentCommandTypes, Merge<TCommandGlobalTypes, TCommandTypes>>, TRequired>
TMappedEnvVar extends MapValue<TEnvVar, TMappedValue>
optional
TRequired extends EnvVarOptions["required"] = undefined
optional
TPrefix extends EnvVarOptions["prefix"] = undefined
optional
TMappedValue = undefined

Parameters

description: string
optional
options: Omit<EnvVarOptions, "value"> & { required?: TRequired; prefix?: TPrefix; value?: EnvVarValueHandler<MapTypes<ValueOf<TEnvVar>>, TMappedValue>; }

Returns

Command<TParentCommandGlobals, TParentCommandTypes, Merge<TCommandOptions, TMappedEnvVar>, TCommandArguments, TCommandGlobals, TCommandTypes, TCommandGlobalTypes, TParentCommand>