RunKit + npm: yargs

node v18.11.0
endpointsharetweet
var yargs = require("yargs") const { argv } = yargs(["333"]) .scriptName("pirate-parser") .usage("$0 [WCA event ID") .command("333", "welcome ter yargs!", (yargs) => { yargs.positional("eventID", { type: "string", describe: "WCA event ID", }); }) .strictOptions(); console.log(argv._[0] === "333"); // should be true console.log(argv._[0] === 333); // should be false
Created from: https://npm.runkit.com/yargs
Loading…