Get started in minutes.
Install the package, define your media config, and ship your first upload with a single runtime.
Install
Add Better Media, then bring in the adapters and plugins your app needs.
npm i @better-media/frameworkConfigure
Create a small media config that defines your storage, database, and plugins.
media.config.tsFirst Upload
Ingest your first file through one upload API and let the pipeline do the rest.
await media.upload.ingest({...})Built for production media flows.
One upload pipeline with strong defaults, portable adapters, and operational features that fit real applications.
Agnostic Storage Layer
The same API for S3, Azure Blob, GCS, or Local FS. Change your provider in production with zero code changes to your application logic.
Safe by Default
Automatic Magic Number validation for MIME types. Stream-based processing ensures huge files never crash your server instance.
Runtime Optimized
Zero-dependency core. Ultra-small bundle footprint. Built on the fastest streaming primitives available in Node.js and Deno.
Presigned Everything
Handle multi-gigabyte uploads without touching your server. Secure, time-limited presigned URLs with one function call.
Framework Agnostic Support
Better Media is built to work across the most popular Node.js frameworks and beyond. Whether you're building APIs, microservices, or full-stack applications, integration is simple and consistent.
Unified architecture.
Core defines contracts. Adapters implement infrastructure. The framework orchestrates the upload lifecycle around one consistent model.
Better Media Core
Contracts and lifecycle primitives for uploads, validation, processing, and persistence.
Database Adapters
PostgreSQL, MongoDB, SQLite, and schema tooling.
Storage Adapters
S3, Cloudflare R2, Google GCS, filesystem, or memory.
Official Plugins
Validation, virus scanning, and media processing hooks.
Bring your own stack.
Better Media doesn't lock you into a provider. Mix and match databases and storage backends with zero code changes.
Databases
Structured metadata
Storage Adapters
Object storage backends
Official plugins.
Extend functionality without writing boilerplate. Plug in validation, scanning, and media processing on the same upload lifecycle.
@better-media/plugin-validation
Strict MIME validation, size checks, and upload policy enforcement.
npm i @better-media/plugin-validation@better-media/plugin-virus-scan
ClamAV-powered scanning to stop unsafe files before they reach storage.
npm i @better-media/plugin-virus-scan@better-media/plugin-media-processing
Resize, optimize, and prepare media assets as part of the upload lifecycle.
npm i @better-media/plugin-media-processingBetter together.
Better Media is powered by contributors from all over the world.