Skip to main content

Type Alias: MediaSource

MediaSource = string | Buffer | Readable | { url: string; } | { path: string; } | { stream: Readable; }

Defined in: media/resolve.ts:13

Source of a media file. You can pass:

  • a local path: './cat.jpg'
  • an http(s) URL: 'https://example.com/cat.jpg' (works with S3 public or presigned URLs)
  • an in-memory Buffer: Buffer
  • a Node stream: Readable (e.g. an S3 GetObject body)
  • an explicit object: { url }, { path } or { stream }