gulp-http-put

0.2.1 • Public • Published

gulp-http-put

NPMNPM

npm npm npm npm

bitHound Overall Score Inline docs Build Status Coverage Status

GitHub stars GitHub watchers

Makes an HTTP PUT for each file on the selected URL. I allows to define custon options that will be passed to request module.

Features

  • Custom PUT params via request module
  • Support callback method
  • Raises error when failing

Installation

$ npm install gulp-http-put --save-dev

Examples

  • Put with custom options and callback
var put = require("gulp-http-put");
 
gulp.task("put",function(){
    gulp.src("src/**/*.js")
        .pipe(put("http://www.mysite.com/",
            {
                "headers": {
                 "Custom-Header": "This is a custom HTTP header"
                },
                "callback": function(err, response, body) {
                    if(!err) {
                        //yor code
                    }
                }
            }
        ));
});

Options Format

Options used by request module. For example:

  • options.callback Callback function called with error, response, body params.
  • options.headers Headers added to the request HTTP PUT message

Dependencies (3)

Dev Dependencies (7)

Package Sidebar

Install

npm i gulp-http-put

Weekly Downloads

25

Version

0.2.1

License

MIT

Last publish

Collaborators

  • gjurgens