node-uploader

1.0.0 • Public • Published

node-uploader - An uploader utility for Node

Install

npm install node-uploader

Usage

var uploader = require('node-uploader');
/**
 * @param {Object} options 文件上传的设置项
 *     @param {String} options.url 服务器接收地址
 *     @param {Object} options.files 上传的文件哈希
 *     @param {Object} options.data 上传携带的额外表单数据
 * @param {Function} callback 上传过程的回调函数
 */
uploader.upload({
  url: 'http://my-service.com/upload-endpoint',
  files: {
    key1: 'photo.png',
    key2: 'data.txt'
  },
  data: {
    username: 'xiaobai'
  }
}, function(e, response){
  if(!e){
    console.log(response);
  }
});

Licence

ATT is free to use under MIT license.

Bugs & Feedback

Please feel free to report bugs or feature requests. You can send me private message on github, or send me an email to: [colorhook@gmail.com]

Readme

Keywords

none

Package Sidebar

Install

npm i node-uploader

Weekly Downloads

2

Version

1.0.0

License

none

Last publish

Collaborators

  • colorhook