API
The plugin contract types and helpers - FilesPlugin, FilesOperation, handlers, and createFiles. See the overview for how they compose.
The types and helpers that make up the plugin system. See the overview for how wrap, extend, and the pipeline fit together.
FilesPlugin
The plugin object you pass to plugins. A name plus up to two optional capabilities - wrap and extend.
Prop
Type
FilesOperation
The discriminated union handed to wrap - one variant per public verb, carrying the caller-facing inputs. The array forms of upload / download / head / exists / delete set bulk: true on each fanned-out item.
Prop
Type
handlers
function handlers(map: PluginHandlers): FilesPlugin["wrap"];Builds a wrap from a per-verb map. Each handler is typed to its own operation and a same-kind next; verbs absent from the map pass through untouched.
createFiles
function createFiles(
opts: FilesOptions & { plugins?: FilesPlugin[] }
): Files & ExtensionsOf<plugins>;Constructs a Files instance whose type includes every plugin's extend surface. Runtime-identical to new Files(opts) - it exists only to surface the added methods on the type.
Overview
Wrap every operation on a Files instance in an ordered pipeline - transform, veto, or observe - and contribute new namespaced methods. The interceptable superset of hooks.
compression
Transparently compress object bodies at rest with gzip, deflate, or deflate-raw. The original size and algorithm ride along in metadata, and reads decompress automatically - provider-agnostic, no native dependencies.