1.0.3 • Published 4 years ago

convertio v1.0.3

Weekly downloads
2
License
ISC
Repository
github
Last release
4 years ago

Convertio (An unofficial convertio.co api for nodejs)

Interact with the https://convertio.co API through nodejs! Super simple.

Attention: Because this module is very new, some of its api may change in the future.

Install

npm install convertio

Usage Examples

const api = new Convertio("<< SECRET API KEY >>");

Convert From Url

const url = "https://i.imgur.com/AEDX42G.jpg";

api.convertFromUrl(url, "png");

Convert File on Disk

const fs = require("fs");
const buffer = fs.readFileSync("/path/to/file.pdf");

api.convertFromBuffer(buffer, "docx");

Get Status of Conversion

const status = await api.getStatus("CONVERSION ID");
console.log(`Step ${status.step} is at ${status.stepPercent}%`);

Write Converted File to Disk

const fs = require("fs");

const buffer = await api.getFileContent("CONVERSION ID");
fs.writeFileSync("/path/to/file.png", buffer);

Add a Webhook to the Conversion

const url = "https://i.imgur.com/AEDX42G.jpg";

api.convertFromUrl(url, "png", { callbackUrl: "https://example.com/webhook" });

Roadmap

  • Add Direct File Upload For Conversion
1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago