Skip to content

Instantly share code, notes, and snippets.

@FreePhoenix888
Last active February 26, 2024 07:51
Show Gist options
  • Save FreePhoenix888/43da366dd1a7107bce7424af154f5c91 to your computer and use it in GitHub Desktop.
Save FreePhoenix888/43da366dd1a7107bce7424af154f5c91 to your computer and use it in GitHub Desktop.
Yargs Boilerplate
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