MCPcopy
hub / github.com/npmx-dev/npmx.dev / getMarkdownReadme

Function getMarkdownReadme

server/api/registry/readme/markdown/[...pkg].get.ts:5–15  ·  view source on GitHub ↗
(event: H3Event)

Source from the content-addressed store, hash-verified

3import { resolvePackageReadmeSource } from '#server/utils/readme-loaders'
4
5export default async function getMarkdownReadme(event: H3Event) {
6 try {
7 const packagePath = getRouterParam(event, 'pkg') ?? ''
8 return await resolvePackageReadmeSource(packagePath)
9 } catch (error: unknown) {
10 handleApiError(error, {
11 statusCode: 502,
12 message: ERROR_NPM_FETCH_FAILED,
13 })
14 }
15}

Callers

nothing calls this directly

Calls 1

handleApiErrorFunction · 0.85

Tested by

no test coverage detected