Giter Site home page Giter Site logo

berdon / minimist2 Goto Github PK

View Code? Open in Web Editor NEW
20.0 2.0 2.0 88 KB

TypeScript/JavaScript ES6 rewrite of popular Minimist argument parser

License: MIT License

JavaScript 43.43% TypeScript 56.57%
typescript argparse argument-parser yarg yargs command-line command-line-tool command-line-parser

minimist2's Introduction

Minimist2

Build Status NPM Status

Minimist2 is a rewrite of the popular Minimist Javascript library for argument parsing. The library aims to be a drop-in replacement with matching API footprint. It passes all original Minimist unit tests.

Minimist2 is written in TypeScript targetting ES6.

Installing

npm install minimist2

Development

  1. Checkout the code
    git clone [email protected]:berdon/minimist2.git
    npm install
  2. Develop
  3. Run tests
    npm test
  4. Submit a pull request

Using

var argv = require('minimist2')(process.argv.slice(2));
console.dir(argv);
$ node example/parse.js -a beep -b boop
{ _: [], a: 'beep', b: 'boop' }
$ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop foo bar baz
{ _: [ 'foo', 'bar', 'baz' ],
  x: 3,
  y: 4,
  n: 5,
  a: true,
  b: true,
  c: true,
  beep: 'boop' }

minimist2's People

Contributors

berdon avatar dependabot[bot] avatar unional avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

unional kt3k

minimist2's Issues

feature request: @types/minimist2

It can help to solve warnings like:

Could not find a declaration file for module 'minimist2'. '~/node_modules/minimist2/lib/index.min.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/minimist2` if it exists or add a new declaration (.d.ts) file containing `declare module 'minimist2';`ts(7016)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.