Open this example in the interactive library
Source code
import { parseArgs } from "node:util";
console.log(
parseArgs({
args: ["-v"],
options: { verbose: { type: "boolean", short: "v" } },
}).values,
);
Sample output
[Object: null prototype] { verbose: true }