private npm is here.

publish unlimited private modules for just $7/month

Extract command-line arguments from a list, removing matches from the original array

If you are a robot, enter text here

extract-flags

Extract command-line arguments from a list, removing matches from the original
array. Useful for providing custom arguments for a wrapper executable, but
passing unexpected arguments back onto the original executable if not expected.

Only supports a subset of what you'd get with
minimist, so unless you're explicitly
looking to modify the arguments array you're better off using that module.

Where argv is an array of arguments, and flags is an object formatted
like so:

{

t:String

, transform:String

, debug:Boolean

}

Each key represents a command-line flag, and the value should be either
String, Number or Boolean to denote its type. argv will be modified
in-place to remove matched flags, and you will get an object in return
with the extracted values: