Skip to content

Instantly share code, notes, and snippets.

@crashmax-dev
Created December 27, 2023 12:25
Show Gist options
  • Save crashmax-dev/b0ae53b3268c1d077bbc3c17257bba9a to your computer and use it in GitHub Desktop.
Save crashmax-dev/b0ae53b3268c1d077bbc3c17257bba9a to your computer and use it in GitHub Desktop.
import { parseArgs } from "node:util";
const args = parseArgs({
options: {
name: {
type: "string",
short: "n",
},
verbose: {
type: "boolean",
short: "v",
},
},
});
console.log(args);
// > {
// > values: { name: 'Budgie', verbose: true },
// > positionals: []
// > }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment