converteer v2.0.0
converteer 🔄
WORK IN PROGRESS - DO NOT INSTALL
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.
Installation
Install via NPM or yarn:
npm install -g converteer
yarn add converteer
Usage (cli)
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.
Usage (library)
You can import converteer in your application like any normal npm package:
import Converter from "converteer";
import images from "converteer-images";
// Then load desired plugins:
Converter.use(images); // 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.
Errors
The following errors are thrown during convertion:
MissingConverterError
is thrown when a transformation (e.g. from jpeg -> png) is not supported by any loaded plugin.PluginConverterError
is thrown when a plugin can't convert the given input.
Plugins
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.
Planned Features
- More Transformers (e.g. csv -> json, ts -> js, json -> xml)
- More "input" and "output" sources (currently input has to be a file, I'd like to support streams as well)
- More generalized reporting (e.g. progress bars, error handling)
- GUI (possibly electron?)