Skip to content

getProcessArguments

Retourne les arguments de processus passés en ligne de commande.

Exemple

ts
import { 
A
, type
ExpectType
,
S
} from "@duplojs/utils";
import {
getProcessArguments
} from "@duplojs/server-utils";
const
argumentsList
=
getProcessArguments
();
const
portArgument
=
A
.
find
(
argumentsList
,
S
.
startsWith
("--port="),
); type
check
=
ExpectType
<
typeof
portArgument
,
`--port=${string}` | undefined, "strict" >; if (
A
.
includes
(
argumentsList
, "--verbose")) {
// has verbose flag }

Syntaxe

typescript
function getProcessArguments(): string[]

Paramètres

Cette fonction ne prend aucun paramètre.

Valeur de retour

  • string[] : arguments de ligne de commande après la partie exécutable/script.

Voir aussi

Diffusé sous licence MIT.