Coder Social home page Coder Social logo

boring's Introduction

boring

A command line argument parser without pirates

what you get

When someone types:

node app jump sideways --foo --bar=whee --super-cool=totally

You get:

{
  _: [ "jump", "sideways"],
  foo: true,
  bar: "whee",
  "super-cool": "totally"
}

Notice that parameters without --, if any, go into the _ array. Parameters with -- become properties in their own right.

How you get it

var argv = require('boring')();

What you don't get

Single hyphens: nope

There is no support for old-fashioned "single-hyphen" options, like:

-x 50

Or:

-h

You can't tell which are boolean and which take arguments unless a specification is passed in. And that's not boring enough for me.

Usage messages, strictness, etc.: nope

These are very simple to implement, and if you're like me, you'd rather do it yourself.

Philosophy

I have nothing against full-featured, pirate-themed option parsers, which are very nice if you're into that sort of thing. I just find myself walking the plank when my options don't follow the pattern of what's easy to validate with piracy.

This simple module is too dumb to break.

About P'unk Avenue and Apostrophe

boring was created at P'unk Avenue for use in Apostrophe, an open-source content management system built on node.js. If you like boring you should definitely check out apostrophenow.org. Also be sure to visit us on github.

Support

Feel free to open issues on github.

boring's People

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.