2.0.2 • Published 6 years ago

ackee-node-sdk-image-server v2.0.2

Weekly downloads
112
License
ISC
Repository
gitlab
Last release
6 years ago

Node.js SDK for Resizin

Node.js wrapper around Resizin api.

Import

  • Package import and initialization
        //when defining all params
        const upload = require("node-sdk-image-server")('apikey', 'baseurl', 'type'); 
        //simple usage
        const upload = require("node-sdk-image-server")('apikey'); 
  • baseUrl contains default value which serves resizin production server
  • type can be image or file and defines whether you will work only with images or with files. When file is selected you can still upload images. Restrictions are only for image type.

Upload

  • Upload file in code
    const fs = require('fs');
    const file = fs.createReadStream('/tmp/feedback.pdf');
    upload("myId", file, "application/pdf").then(fileDetails => {
    console.log(fileDetails);
    });

function takes 3 parameters id of the file file file it self which is stream or buffer and mime-type. If not specified mime-type defaults to application/octet-stream client / browser should provide you with correct mime-type. Or you should know the type of file from somewhere else.

License

MIT

Dominik Veselý

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.0.0

7 years ago