mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-17 16:50:22 +00:00
1 KiB
1 KiB
Draft Transloadit JavaScript SDK architecture
The main Processor
- Processor (Transloadit?) accepts
optionsand an array ofplugins(each plugin also has ownoptions) - Processor iterates on plugins, calles each of them and returns the result.
- The result is passed from the plugin to
prepareMediafor some final processign - Then the processed stuff goes into
uploadwhich uploads everything to Transloadit
Plugins
- We should be able to register a plugin with something like:
transloadit.plugin('dragndrop', function(options) {
console.log('dragging and dropping here');
});
or:
transloadit.use(dragndrop, {
selector: '.drop'
});
- ?
Usage
import transloadit from 'transloadit';
import dragndrop from 'transloadit-dragndrop';
import dropbox from 'transloadit-dropbox';
transloadit([
dragndrop(),
dropbox({
folder: '/media',
allowSmth: true
})
])
.then(function (result) {
console.log(`Done processing: ${result}`);
});