0.1.1 • Published 9 years ago

cliable v0.1.1

Weekly downloads
-
License
MIT
Repository
-
Last release
9 years ago

CLIABLE

Easily add options to your cli's

Installation

In your projects directory:

npm install --save cliable

Usage

In node.js:

#!/usr/bin/env node

const args = require('cliable');

args.addOption('domain', 'Some domainz', 'exapmle.com');
args.addOption('port', 'Da port', 80);

var arguments = args.start(process.argv.slice(2), 'A helpful text');

//do something with arguments

Cli usage

Users can pass in options using yourapp --port 3000.

Accessing options in your code

if (arguments.domain) {
  // you can access arguments.domain
  console.log(arguments.domain)
}

Using help

arguments.help is false if everything is fine, else it's a string you can log to the console.

That's is!

0.1.1

9 years ago

0.1.0

9 years ago