@skypilot/parsifal
v1.0.0-alpha.21
Published
Intelligent and flexible parser for command-line arguments
Downloads
24
Maintainers
Readme
@skypilot/parsifal
Intelligent and flexible command-line parser
Example
import { parseCliArgs } from 'parsifal';
const parsedArgs = parseCliArgs({
named: [
{ name: 'myNamedArg' }
],
positional: [
{ name: 'myPositionalArg' },
{ name: 'anotherPositionalArg' },
]
});
$ node my-script.js --named=1 2 3 unexpectedArg
/*
parsedArgs = {
_positional: [2, 3, 'unexpectedArg'],
_unparsed: [],
myNamedArg: 1,
myPositionalArg: 2,
anotherPositionalArg: 3,
}
*/