@vite-hub/source
v0.0.1
Published
Typed source retrieval primitives for ViteHub.
Downloads
370
Maintainers
Readme
@vite-hub/source
@vite-hub/source loads files, globs, markdown, GitHub content, or custom data before something else places it in a workspace.
Install
pnpm add @vite-hub/sourceMinimal API
// server/utils/sources.ts
import { defineSources, file, github, glob, registerSources, useSource } from "@vite-hub/source"
registerSources(defineSources({
docs: glob({ include: "docs/**/*.md" }),
readme: file("README.md"),
upstream: github({ repo: "vite-hub/vitehub" }),
}))
const docs = useSource("docs", { rootDir: process.cwd() })
const keys = await docs.keys()
const first = await docs.read(keys[0]!)Used by
@vite-hub/workspace materializes Source output into workspace files. Use this package directly when you only need typed source loading and not a workspace file tree.
Built on tinyglobby, picomatch, and mrmime.
Learn more at vitehub.dev.
