2.3.3 • Published 2 years ago

@bitkidd/adonisjs-cloudconvert v2.3.3

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

@bitkidd/adonisjs-cloudconvert

adonis, adonisjs, cloudconvert

npm-image license-image typescript-image

A short brief

A CloudConvert provider for AdonisJS v5.x

Installation

You may install this package via:

npm i @bitkidd/adonisjs-cloudconvert
# or
yarn add @bitkidd/adonisjs-cloudconvert

After installation you have to configure it:

node ace configure @bitkidd/adonisjs-cloudconvert

This will create /config/cloudconvert.ts file where you can configure the provider.

This package depends on one main ENV variable, CLOUDCONVERT_API_KEY, please add it to your env.ts file and into actual .env file.

Usage

To use CloudConvert provider you should call it via import

import CloudConvert from '@ioc:Adonis/Addons/CloudConvert'

const job = await CloudConvert.jobs.create({
  tasks: {
    'import-my-file': {
      operation: 'import/url',
      url: 'https://my-url'
    },
    'convert-my-file': {
      operation: 'convert',
      input: 'import-my-file',
      output_format: 'pdf',
      some_other_option: 'value'
    },
    'export-my-file': {
      operation: 'export/url',
      input: 'convert-my-file'
    }
  }
});

To properly configure this provider, follow the docs here: cloudconvert