@skypilot/parsifal
TypeScript icon, indicating that this package has built-in type declarations

1.0.0-alpha.21 • Public • Published

@skypilot/parsifal

Intelligent and flexible command-line parser

npm alpha alpha build license: ISC

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,
  }
*/

Package Sidebar

Install

npm i @skypilot/parsifal

Weekly Downloads

0

Version

1.0.0-alpha.21

License

ISC

Unpacked Size

67.6 kB

Total Files

109

Last publish

Collaborators

  • williamthorsen