Use a custom template registry
mainA custom registry is an HTTP endpoint that responds to /:template.json requests. The JSON response must include:
name: (required) Template name.tar: (required) Link to the tarball download.defaultDir: (optional) Default directory.url: (optional) Webpage URL.subdir: (optional) Subdirectory inside the tar.headers: (optional) Custom headers for the download.
You can register a custom registry using the registryProvider utility:
import { downloadTemplate, registryProvider } from "giget";
const themes = registryProvider("https://raw.githubusercontent.com/unjs/giget/main/templates");
await downloadTemplate("themes:test", {
providers: { themes },
});import { registryProvider } from "giget";
const themes = registryProvider("https://raw.githubusercontent.com/unjs/giget/main/templates");
const { source, dir } = await downloadTemplate("themes:test", {
providers: { themes },
});