Module: Media Processing
Media processing and delivery with pluggable providers. Ships with providers for Cloudinary (Upload API + URL-based transforms), Uploadcare (REST API + CDN delivery with on-the-fly transforms), and imgix (URL-based transforms with signed URLs and responsive srcset generation), plus an in-memory mock for testing. Includes a fluent immutable TransformBuilder, named transform presets, factory-based registry, per-instance circuit breakers, OTel metrics, and native fetch throughout.
| Name | module-media-ts |
| Version | 0.1.0 |
| Category | composable-modules |
| License | Apache-2.0 |
| Persona | engineering |
| Tags | media, images, cloudinary, uploadcare, imgix, transforms, typescript |
| Source | templates/module-media-ts |
Render it
Three front doors, one catalog. Pick whichever suits the caller.
# CLI
npx @nanohype/sdk render module-media-ts --out ./my-app
# SDK
import { LocalSource, renderTemplate } from "@nanohype/sdk";
const result = await renderTemplate(source, "module-media-ts", variables);
# MCP — from an agent
get_template({ name: "module-media-ts" })Prerequisites
| Tool | Version | Why |
|---|---|---|
node | >=22 | Node.js runtime for the media module |
Variables
Required
ProjectNamestring- Kebab-case project name, used as package name and directory Must be lowercase kebab-case starting with a letter.
Optional
Descriptionstring — defaults toMedia processing and delivery with pluggable providers- Short project description for package.json and README
MediaProviderstring — defaults tocloudinary- Default media provider (cloudinary, uploadcare, imgix, mock, or a custom name)
What it produces
29 files. Placeholder names such as __APP_NAME__ are what the renderer substitutes into.
.env.example
.gitignore
biome.json
package.json
README.md
src/media/__tests__/builder.test.ts
src/media/__tests__/mock.test.ts
src/media/__tests__/presets.test.ts
src/media/__tests__/registry.test.ts
src/media/__tests__/signing.test.ts
src/media/bootstrap.ts
src/media/config.ts
src/media/index.ts
src/media/logger.ts
src/media/metrics.ts
src/media/providers/cloudinary.ts
src/media/providers/imgix.ts
src/media/providers/index.ts
src/media/providers/mock.ts
src/media/providers/registry.ts
src/media/providers/types.ts
src/media/providers/uploadcare.ts
src/media/resilience/__tests__/circuit-breaker.test.ts
src/media/resilience/circuit-breaker.ts
src/media/transforms/builder.ts
src/media/transforms/presets.ts
src/media/types.ts
tsconfig.json
vitest.config.tsComposes with
- Pairs with
ts-service - Pairs with
next-app - Pairs with
module-storage-ts - Nests inside
monorepo