moon-cycle/.github/wiki/api/functions/cdnUrl.md
Aric Camarata 208f7ffba1 docs: add TypeDoc API generation (typedoc@0.28.19 + typedoc-plugin-markdown@4.11.0)
Add typedoc and typedoc-plugin-markdown as devDependencies. Add typedoc.json config
targeting src/index.ts with markdown output to .github/wiki/api. Add docs script to
package.json. Generate initial API reference pages.

Part of T-E8-03 — TypeDoc automation for all 12 JS/TS packages.
2026-05-30 16:42:00 -04:00

1.2 KiB

moon-cycle v2.0.0


moon-cycle / cdnUrl

Function: cdnUrl()

cdnUrl(filename, set, size, quality, ref?): string

Defined in: helpers.ts:36

Returns a jsDelivr CDN URL for a specific moon image.

jsDelivr serves files directly from GitHub repositories, making it a practical option for web applications that need the images without bundling ~438 MB of assets locally.

Parameters

filename

string

Filename returned by cycleMonth or cycleYear, e.g. "354.webp".

set

ImageSet

Image set: 'mm' (monthly) or 'my' (yearly).

size

ImageSize

Image dimension: 256 or 512.

quality

ImageQuality

WebP quality: 75 or 85.

ref?

string = 'main'

Git ref (branch, tag, or commit SHA). Defaults to 'main'.

Returns

string

A full CDN URL string.

Example

const file = cycleMonth();
const url = cdnUrl(file, 'mm', 256, 75);
// => 'https://cdn.jsdelivr.net/gh/acamarata/moon-cycle@main/mm-256-75/354.webp'