passed

2.0.3 • Public • Published

passed

Install

From NPM:
npm install passed

From GitHub:
npm install xist/passed

Example

const app = passed("my command here --myOption John -myFlag");
// const app = passed(process.argv); <- You can do this too!
 
app.getCommand(); // my command here
app.getOptions(); // { myOption: "John", myFlag: true }
app.getOption("myOption"); // John
app.getOption("myFlag"); // true

That's it! 😜 You now have access to the passed options.

Extras

You can even handle commands using .on.

app.on("my command here", function(options) {
  // the first .on to match gets called, others get ignored
});

Contribute

Pull requests are encouraged.

Package Sidebar

Install

npm i passed

Weekly Downloads

5

Version

2.0.3

License

MIT

Unpacked Size

7.37 kB

Total Files

10

Last publish

Collaborators

  • xist