0.0.5 • Published 9 years ago
commander-file v0.0.5
Commander file
Receive file/uri and stdin at commander.js
- Fetch data after parse via first argument or
--stdin
. - First argument always return the file.
Usage
$ npm install commander-file --save
./program.js
#!/usr/bin/env node
var program = require('commander-file');
program
.version('0.0.0')
.usage('<file/url> dostaff [options...]')
.parse(process.argv).then(function(data){
console.log(data);
console.log(program.args[0]);
console.log(program.args[1]);
});
$ node program.js --help
#
# Usage: program <file/url> dostaff [options...]
#
# Options:
#
# -h, --help output usage information
# -S, --stdin use the stdin
# -V, --version output the version number
# stdin
$ echo -n 'foo' | node program.js --stdin dostaff
# foo
# null
# dostaff
$ node program.js bar.txt dostaff
# bar
# bar.txt
# dostaff
# uri
$ node program.js http://example.com/baz.txt dostaff
# baz
# http://example.com/baz.txt
# dostaff
License
0.0.5
9 years ago
0.0.4
9 years ago
0.0.3
9 years ago
0.0.2
9 years ago
0.0.1
9 years ago
0.0.0
9 years ago
0.0.0-beta.0
9 years ago
0.0.0-alpha.3
9 years ago
0.0.0-alpha.2
9 years ago
0.0.0-alpha.1
9 years ago
0.0.0-alpha.0
9 years ago