Last active
February 26, 2024 07:51
-
-
Save FreePhoenix888/43da366dd1a7107bce7424af154f5c91 to your computer and use it in GitHub Desktop.
Yargs Boilerplate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import yargs from "yargs"; | |
import { hideBin } from "yargs/helpers"; | |
const cliOptions = yargs(hideBin(process.argv)) | |
.usage(`$0 [Options]`, `Description of the program`) | |
.options({ | |
verbose: { | |
alias: "v", | |
description: "Enable verbose logging", | |
type: "boolean", | |
}, | |
output: { | |
alias: "o", | |
description: "Specify output file", | |
type: "string", | |
}, | |
}) | |
.strict() | |
.parseSync(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment