Open this example in the interactive library
Source code
import { parseArgs } from "node:util";
console.log(
parseArgs({ args: ["--", "--draft"], allowPositionals: true }).positionals,
);
Sample output
[ '--draft' ]

Open this example in the interactive library
import { parseArgs } from "node:util";
console.log(
parseArgs({ args: ["--", "--draft"], allowPositionals: true }).positionals,
);
[ '--draft' ]