Skip to content

kessler/parse-arguments

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

parse-arguments

A small lib for parsing command line arguments strings or arrays. E.g:

"positional --flag --namedArgument=namedParam"

Install

npm i -S @kessler/parse-arguments

Example

const parseArguments = require('@kessler/parse-arguments')

const { positional, named, warnings } = parseArguments('positional --flag --named1 val1 --named2=val2')

// an array works too:
parseArguments(['positional', '--flag', '--namedArgument', 'namedParam'])

About

parse command line style positional and named arguments, eg. `cmd positional --name=foo`

Resources

Stars

Watchers

Forks

Packages

No packages published