Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
RunKit + npm: yargs
node v18.11.0
endpoint
share
tweet
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…
Clone and edit this document