Open this example in the interactive library
Source code
import { parseArgs } from "node:util";
console.log(
(() => {
try {
parseArgs({ args: ["--missing"] });
} catch (error) {
return error.code;
}
})(),
);
Sample output
ERR_PARSE_ARGS_UNKNOWN_OPTION
