jipics

2.0.0 • Public • Published

jipics

Node.JS wrapper for jipics image hosting website.

Installation

$ npm i jipics

Example

// Dependencies
var Jipics = require("jipics")
  , Request = require("request")
  ;
 
// Upload the local file
Jipics.upload(__dirname + "/heisencat.png", function (err, data) {
    console.log(err || "Image sucessfully uploaded: " + JSON.stringify(data, null, 4));
});
 
// Upload some laaaarge file, from remote
Jipics.upload({
    stream: Request("https://github.com/IonicaBizau/node-statique/raw/master/examples/public/images/large.jpg")
}, function (err, data) {
    console.log(err || "Image sucessfully uploaded: " + JSON.stringify(data, null, 4));
});
 

Documentation

upload(options, callback)

Uploads an image to jipics.net.

Params

  • Object options: A string representing the image path or an object:
    • path (String): the path to the image.
    • stream (Stream): a readable stream to get the image from (remote, hard-disk etc).
    • deleteAfterUpload (Boolean): if true, the image will be deleted after a sucessful upload.
  • Function callback: The callback function.

Return

  • Request The request object.

How to contribute

Have an idea? Found a bug? See how to contribute.

License

See the LICENSE file.

Package Sidebar

Install

npm i jipics

Weekly Downloads

0

Version

2.0.0

License

MIT

Last publish

Collaborators

  • ionicabizau