JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 114
  • Score
    100M100P100Q76875F
  • License MIT

Upload images to imgur

Package Exports

  • imgur-uploader

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (imgur-uploader) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

imgur-uploader Build Status

Upload images to imgur

See imgur-uploader-cli for the command-line version.

Install

$ npm install --save imgur-uploader

Usage

var fs = require('fs');
var imgurUploader = require('imgur-uploader');

imgurUploader(fs.readFileSync('cat.jpg'), function (err, res) {
    console.log(res);
    /*
    {
        id: 'OB74hEa',
        link: 'http://i.imgur.com/jbhDywa.jpg',
        date: Sun May 24 2015 00:02:41 GMT+0200 (CEST),
        type: 'image/jpg',
        ...
    }
    */
});

You can also use the streaming interface like below:

var fs = require('fs');
var stream = require('imgur-uploader').stream();

stream.on('upload', function (res) {
    console.log(res);
    /*
    {
        id: 'OB74hEa',
        link: 'http://i.imgur.com/jbhDywa.jpg',
        date: Sun May 24 2015 00:02:41 GMT+0200 (CEST),
        type: 'image/jpg',
        ...
    }
    */
});

fs.createReadStream('cat.jpg').pipe(stream);

License

MIT © Kevin Martensson