jurl
Version:
A minimal but useful cURL wrapper.
28 lines (23 loc) • 763 B
JavaScript
/**
* Created by instancetype on 8/19/14.
*/
/* jshint bitwise : true, eqeqeq : true, forin : true, noarg : true, noempty : true, nonew : true,
asi : true, esnext : true, laxcomma : true, sub : true, browser : true, node : true, phantom : true */
const
parseInput = require('./parseInput')
, spawnJurler = require('./spawnJurler')
, program = require('commander')
program
.version('0.2.4')
.usage('<get|head|post|put|delete> <URL> [key=value] ... [key=value]')
program.parse(process.argv)
function jurl() {
var
args = program.args
, defaultConfig = { method : 'HEAD', data : '' }
, curlOpts
if (!args.length) return program.help()
curlOpts = parseInput(args, defaultConfig)
spawnJurler(curlOpts)
}
module.exports = { jurl : jurl }