Header menu logo Nao

Converter Module

Top-level conversion helpers over a `ConverterRegistry`.

Functions and values

Function or value Description

Converter.convertBytes registry sourceMediaType targetMediaType ctx input

Full Usage: Converter.convertBytes registry sourceMediaType targetMediaType ctx input

Parameters:
Returns: byte[]

Convert raw bytes from one media type to another, returning the produced bytes. Resources are extracted/resolved through `ctx`.

registry : ConverterRegistry
sourceMediaType : string
targetMediaType : string
ctx : ConversionContext
input : byte[]
Returns: byte[]

Converter.convertFile registry sourceMediaType targetMediaType sourcePath targetPath

Full Usage: Converter.convertFile registry sourceMediaType targetMediaType sourcePath targetPath

Parameters:
    registry : ConverterRegistry
    sourceMediaType : string
    targetMediaType : string
    sourcePath : string
    targetPath : string

Convert a file on disk to another format on disk, extracting media into a bundle directory alongside the output (defaults to the output's folder).

registry : ConverterRegistry
sourceMediaType : string
targetMediaType : string
sourcePath : string
targetPath : string

Type something to start searching.