gulp-http-post
Advanced tools
Comparing version 0.0.3 to 0.1.0
@@ -31,3 +31,3 @@ "use strict"; | ||
}, (err, response, body)=> { | ||
option.callback && option.callback(err, body); | ||
option.callback && option.callback(err, body, response); | ||
if (err) { | ||
@@ -34,0 +34,0 @@ throw new pluginError(PLUGIN_NAME, err); |
{ | ||
"name": "gulp-http-post", | ||
"version": "0.0.3", | ||
"description": "http post buffer to current url on pipe.", | ||
"version": "0.1.0", | ||
"description": "Post buffer to current url on pipe, and handle http responses", | ||
"main": "index.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
@@ -47,7 +47,8 @@ # gulp-http-post | ||
encoding: "base64", | ||
callback: function (err, data) { | ||
callback: function (err, body, response) { | ||
if(err){ | ||
console.error(err); | ||
}else{ | ||
console.log(data); | ||
console.log(body); | ||
console.log(response); | ||
} | ||
@@ -54,0 +55,0 @@ }, |
@@ -11,3 +11,3 @@ 'use strict'; | ||
const after = require('mocha').after; | ||
describe('gulp-post', () => { | ||
describe('gulp-http-post', () => { | ||
const filePath = path.join('temp', 'file.tmp'); | ||
@@ -48,4 +48,5 @@ before(done=> { | ||
.pipe(post('https://npmjs.com', { | ||
callback: (err, data)=> { | ||
callback: (err, data, response)=> { | ||
expect(data).to.be.an('string'); | ||
expect(response).to.be.an('object'); | ||
done(); | ||
@@ -52,0 +53,0 @@ } |
8117
91
69