<script type="module">
import { createFilePondEntryTree, createExtensionManager } from 'filepond';
import { SimulatedStore } from 'filepond/extensions/simulated-store.js';
import { ConsoleView } from 'filepond/extensions/console-view.js';
// holds our file entries
const entryTree = createFilePondEntryTree();
// manages our extensions so we can do something with our entries
const extensionManager = createExtensionManager({ entryTree });
extensionManager.extensions = [
// So we can simulate file storage progress
[
SimulatedStore,
{
// Instantly store a file when added
shouldStore: () => true,
},
],
// See what happens in the developer console
ConsoleView,
];
// Set files like this
entryTree.entries = [
// Add a file object
new File(['Hi!'], 'Untitled.txt', { type: 'text/plain ' }),
];
</script>
Headless usage
Using FilePond without a user interface. Useful for programmatic processing of files or when building a custom UI on top of FilePond.