packages-update
Version:
📦 A flexible and lightweight updater for packages
41 lines (40 loc) • 864 B
TypeScript
/**
* Gets the value of an argument.
*
* ---
*
* CLI arguments examples:
*
* ```sh
* command --arg=some # 'some'
* command --arg="" # ''
* command --arg # undefined
* ```
*/
export declare const getArg: <T = string>(arg: string, prefix?: string) => T | undefined;
/**
* Checks if an argument exists.
*
* ---
*
* CLI arguments examples:
*
* ```sh
* command --arg # true
* command # false
* ```
*/
export declare const hasArg: (arg: string, prefix?: string) => boolean;
/**
* Gets the last param/value.
*
* CLI arguments examples:
*
* ```sh
* command --arg --arg2=some value # 'value'
* command value # 'value'
* command # undefined
* command --arg # undefined
* ```
*/
export declare const getLastParam: <T = string>(prefix?: string) => T | undefined;