cl

cmd-ln

Converts command-line arguments to function arguments - for simple CLI programs.

Showing:

Popularity

Downloads/wk

2

GitHub Stars

0

Maintenance

Last Commit

8yrs ago

Contributors

0

Package

Dependencies

0

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

cmd-ln

Converts command-line arguments to function arguments - for simple CLI programs.

Install

npm install cmd-ln

Usage

program:

#! /usr/bin/env node
var cmdLn = require('cmd-ln')

cmdLn(function(action, subject){
  console.log('I am going to do', action, 'with', subject + '.')
})

Running that and get.

$ program make lemonade
I am going to do make with lemonade.
$ program make
Usage: program <action> <subject>
$ program
Usage: program <action> <subject>

Optional Parameters

You can specify optional parameters using a leading underscore:

cmdLn(function(_url){
  var url = _url || 'http://google.com'
  console.log(url)
})

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial