@dot-event/arg
dot-event cli and url arguments
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.