@codexteam/capella-pics
Module for useful image uploading with capella.pics
Last updated 2 years ago by dsnostr .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @codexteam/capella-pics 
SYNC missed versions from official npm registry.

capella.nodejs

Image uploader to Capella

Installation

npm install @codexteam/capella-pics --save

Usage

const Capella = require('@codexteam/capella-pics');

let capella = new Capella();

// upload by URL
capella.uploadFileByURL('https://capella.pics/public/app/capella-logo.png', function (resp) {
    console.log(resp);
});

// upload from local path
capella.uploadFile('C:/Users/Capella/Desktop/capella-logo.png', function (resp) {
    console.log(resp);
});

Response

Return Capella response object if everything is ok, otherwise returns Error message.

Response format

Callback argument description

On error

{
   "success": false,
   "message": <message>
}

On success

{
   "success": true,
   "message": <message>,
   "id": <id>,
   "url": <url>
}

Custom endpoint

You can pass a custom endpoint address to the constructor.

let capella = new Capella({
    endpoint: 'https://capella.pics/upload'
});

License

MIT

Current Tags

  • 1.0.2                                ...           latest (2 years ago)

3 Versions

  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Downloads
Today 0
This Week 3
This Month 3
Last Day 3
Last Week 0
Last Month 4
Dependencies (1)
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |