{"name":"nopt","description":"Option parsing for Node, supporting types, shorthands, etc. Used by npm.","dist-tags":{"latest":"7.2.1"},"versions":{"7.2.1":{"name":"nopt","version":"7.2.1","author":{"name":"GitHub Inc."},"license":"ISC","_id":"nopt@7.2.1","bugs":{"url":"https://github.com/npm/nopt/issues"},"bin":{"nopt":"bin/nopt.js"},"tap":{"nyc-arg":["--exclude","tap-snapshots/**"]},"dist":{"shasum":"1cac0eab9b8e97c9093338446eddd40b2c8ca1e7","tarball":"http://localhost:4260/nopt/nopt-7.2.1.tgz","fileCount":8,"integrity":"sha512-taM24ViiimT/XntxbPyJQzCG+p4EKOpgD3mxFwW38mGjVUrfERQOeY4EDHjdnptttfHuHQXFx+lTP08Q+mLa/w==","signatures":[{"sig":"MEUCIQDsGsywXebnr3VNxXxSfSuZKiPrOTyj3J5TmMy6Wh+dIQIgOqooSxmxbTSlbegMSG8W/S9pHAsXDSFZAdCxO9OQqaU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"http://localhost:4260/attestations/nopt@7.2.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":26203},"main":"lib/nopt.js","engines":{"node":"^14.17.0 || ^16.13.0 || >=18.0.0"},"gitHead":"6d33cd7a772c9594d42417c69e7adeb497b16b03","scripts":{"lint":"eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"","snap":"tap","test":"tap","lintfix":"npm run lint -- --fix","postlint":"template-oss-check","posttest":"npm run lint","template-oss-apply":"template-oss-apply --force"},"repository":{"url":"git+https://github.com/npm/nopt.git","type":"git"},"_npmVersion":"10.7.0","description":"Option parsing for Node, supporting types, shorthands, etc. Used by npm.","directories":{},"templateOSS":{"publish":true,"version":"4.22.0","windowsCI":false,"//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten."},"_nodeVersion":"22.1.0","dependencies":{"abbrev":"^2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tap":"^16.3.0","@npmcli/template-oss":"4.22.0","@npmcli/eslint-config":"^4.0.0"}}},"author":{"name":"GitHub Inc."},"repository":{"url":"git+https://github.com/npm/nopt.git","type":"git"},"license":"ISC","homepage":"https://github.com/npm/nopt#readme","bugs":{"url":"https://github.com/npm/nopt/issues"},"readme":"If you want to write an option parser, and have it be good, there are\ntwo ways to do it. The Right Way, and the Wrong Way.\n\nThe Wrong Way is to sit down and write an option parser. We've all done\nthat.\n\nThe Right Way is to write some complex configurable program with so many\noptions that you hit the limit of your frustration just trying to\nmanage them all, and defer it with duct-tape solutions until you see\nexactly to the core of the problem, and finally snap and write an\nawesome option parser.\n\nIf you want to write an option parser, don't write an option parser.\nWrite a package manager, or a source control system, or a service\nrestarter, or an operating system. You probably won't end up with a\ngood one of those, but if you don't give up, and you are relentless and\ndiligent enough in your procrastination, you may just end up with a very\nnice option parser.\n\n## USAGE\n\n```javascript\n// my-program.js\nvar nopt = require(\"nopt\")\n , Stream = require(\"stream\").Stream\n , path = require(\"path\")\n , knownOpts = { \"foo\" : [String, null]\n , \"bar\" : [Stream, Number]\n , \"baz\" : path\n , \"bloo\" : [ \"big\", \"medium\", \"small\" ]\n , \"flag\" : Boolean\n , \"pick\" : Boolean\n , \"many1\" : [String, Array]\n , \"many2\" : [path, Array]\n }\n , shortHands = { \"foofoo\" : [\"--foo\", \"Mr. Foo\"]\n , \"b7\" : [\"--bar\", \"7\"]\n , \"m\" : [\"--bloo\", \"medium\"]\n , \"p\" : [\"--pick\"]\n , \"f\" : [\"--flag\"]\n}\n// everything is optional.\n // knownOpts and shorthands default to {}\n // arg list defaults to process.argv\n // slice defaults to 2\n , parsed = nopt(knownOpts, shortHands, process.argv, 2)\nconsole.log(parsed)\n```\n\nThis would give you support for a