get-command-flags

1.0.0 • Public • Published

get-command-flags

Install

npm --save get-command-flags

Usage

The flags variable in this example is javascript object of flags.

Running a hypothetical command myprogram firstarg --flag=val --speak bla -t=2

var flags = require('get-command-flags')();
//flags = {flag: 'val', speak: 'bla', t:2}

About

get-command-flags parses command line argument flags.

It also ignores positional arguments.

See the module get-command-args for positional argument getting.

In the browser

It parses the query string (window.location.search), and returns them as a substitute for command line flags.

This way a command line program using get-command-flags will still work in a browser <style> tag src.

Readme

Keywords

Package Sidebar

Install

npm i get-command-flags

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • hollowdoor