MCPcopy Index your code
hub / github.com/npmx-dev/npmx.dev / generateOrgFixture

Function generateOrgFixture

scripts/generate-fixtures.ts:291–304  ·  view source on GitHub ↗
(orgName: string)

Source from the content-addressed store, hash-verified

289}
290
291async function generateOrgFixture(orgName: string): Promise<void> {
292 console.log(` Fetching org packages: ${orgName}`)
293
294 const url = `${NPM_REGISTRY}/-/org/${encodeURIComponent(orgName)}/package`
295
296 try {
297 const data = await fetchJson(url)
298 const path = join(FIXTURES_DIR, 'npm-registry', 'orgs', `${orgName}.json`)
299 writeFixture(path, data)
300 } catch (error) {
301 console.error(` Failed to fetch org ${orgName}:`, error)
302 throw error
303 }
304}
305
306async function generateUserFixture(username: string): Promise<void> {
307 console.log(` Fetching user packages: ${username}`)

Callers 1

mainFunction · 0.85

Calls 2

fetchJsonFunction · 0.85
writeFixtureFunction · 0.85

Tested by

no test coverage detected