0.0.6 • Published 11 years ago

proc-args v0.0.6

Weekly downloads
2
License
-
Repository
github
Last release
11 years ago

proc-args

This is a simple module that abstracts away the difference between taking command-line arguments and reading data from the pipe. Her's an example:

var proc = require('proc-args');

proc(function(arg){
	doneSomethingWith(arg);
});

In the above example arg could either be an argument passed to tyour program from the command line or data piped in from stdin. So if your program is foo then this command foo myfile.js and echo myfile.js | foo can be treated the same.

commander.js

Additionally proc-args wraps Commander.js, adding the ability to use it in this way. For example:

var program = require('proc-args').program;

program
	.version('0.0.1')
	.parse(process.argv);

program.process(function(arg){
	Got the arg!
});
0.0.6

11 years ago

0.0.5

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago