Git Product home page Git Product logo

convert-base-api's Introduction

Base API for convert

Requirements

This is an "ES module"

So it requires a current web browser or NodeJS v14

If you need older support, please try to use something like webpack or babel

Usage

Add it as a dependency to your package.json

yarn add github:ModifiedCommand/convert-base-api

or

yarn add @modifiedcommand/convert-base-api

Create an API class

import {AbstractBaseApi} from "@modifiedcommand/convert-base-api";

/**
 * Class ConvertXYZApi
 */
class ConvertXYZApi extends AbstractBaseApi {
    /**
     * @inheritDoc
     */
    async getInitConverters() {
        return [...];
    }
}

export {ConvertXYZApi};

Use it in your code

import {ConsoleLog, Input, LocalFileInputEntry, LocalFileOutput} from "@modifiedcommand/convert-base-api";
import {ConvertXYZApi} from "...";

let output;
try {
    output = await new ConvertXYZApi(input, output, log, options).convert();
} catch (err) {

}

Input

Import Description
Input The input consists on one input entry (Common)
ArrayInput The input consists on multiple input entries (For instance a selected folder with multiple FileInputEntry)
AbstractInput Base input

Input entry

Import For type
BufferInputEntry - ArrayBuffer
- Blob
- Buffer
- Uint8Array
FileInputEntry File
LocalFileInputEntry Local file
LocalFolderInputEntry Local folder
AbstractInputEntry Base input entry

Output

Import For type
ArrayBufferOutput ArrayBuffer
BlobOutput Blob
BufferOutput Buffer
FileBlobOutput File
LocalFileOutput Local file
LocalFolderOutput Local folder
Uint8ArrayOutput Uint8Array
AbstractOutput Base output

Log

Import Description
ConsoleLog Log to console
SlientLog Disable log
AbstractLog Base log

Options

Key Type Default Description
experimental bool false Enable experimental conversions

convert-base-api's People

Contributors

pisaucer avatar offroaders123 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.