@dot-event/arg

0.0.8 • Public • Published

@dot-event/arg

dot-event cli and url arguments

orbs

Install

npm install dot-event @dot-event/arg @dot-event/store

Setup

const dot = require("dot-event")()
require("@dot-event/arg")(dot)
require("@dot-event/store")(dot)

Auto-detect arguments

const args = dot.arg() // detects args from `process.argv` or `window.location`
args // { _: ["arg"], opt: true }

Manual arguments

const args = dot.arg({
  args: ["arg", "-o"],
  alias: { o: ["opt"] },
})
args // { _: ["arg"], o: true, opt: true }

Options

Option Description
save Save args to store

Credits

This project uses getopts for argument parsing.

Readme

Keywords

Package Sidebar

Install

npm i @dot-event/arg

Weekly Downloads

2

Version

0.0.8

License

MIT

Unpacked Size

5.7 kB

Total Files

5

Last publish

Collaborators

  • winton