Nighttime Peanut Migrations
Miss any of our Open RFC calls?Watch the recordings here! »

convertio

1.0.3 • Public • Published

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

Install

npm i convertio

DownloadsWeekly Downloads

3

Version

1.0.3

License

ISC

Unpacked Size

11.8 kB

Total Files

15

Last publish

Collaborators

  • avatar