Converteer is an AIO command line application (and library) for converting files from and to any possible format. No more downloading multiple applications to convert files.
Install via NPM or yarn:
npm install -g converteer yarn add converteer
You can use converteer via cli or library. The CLI interface works like this:
converteer <input> <output>
Converteer will list all possible converters which are able to handle input and output, then it will present you with a few options to further define how the convertion will take place.
You can import converteer in your application like any normal npm package:
;;// Then load desired plugins:Converter.useimages; // or: Converter.use("converteer-images")// Then in your app you can run:console.log"Converting image...";await Converter.convert'/tmp/useruploads/anypicture.png', '~/system/uploads/images/anypicture.jpg';console.log"Done..."
See the docs for a complete set of features the library provides.
The following errors are thrown during convertion:
MissingConverterErroris thrown when a transformation (e.g. from jpeg -> png) is not supported by any loaded plugin.
PluginConverterErroris thrown when a plugin can't convert the given input.
To keep the converteer core slim we outsourced most of the converters to external plugins.
These are prefixed with
converteer-. Converteer will try to download required plugins automatically if it can't find the required plugin on NPM.
Plugins may further download any required tool like
ffmpeg for convenience. This is done through your system package manager, converteer will ask for root if needed.
If you decide to use converteer as a library you need to manage the dependencies yourself.