# add-registry > Add a new npm package to the docs registry by fetching metadata and building sources - Author: Farrel Darian - Repository: fdarian/docs-registry - Version: 20260204133121 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-06 - Source: https://github.com/fdarian/docs-registry - Web: https://mule.run/skillshub/@@fdarian/docs-registry~add-registry:20260204133121 --- --- name: add-registry description: "Add a new npm package to the docs registry by fetching metadata and building sources" args: package-name --- ## Add Registry Entry ### 1. Fetch package metadata Run `bun internals/entries/cli.ts get npm `. Returns JSON: ```json { "repository": "string | null", "homepage": "string | null", "readme": "string | null" } ``` ### 2. Build the `sources` array **Repository source** — if `repository` is not null: - Clean the URL: strip `git+` prefix and `.git` suffix - Add `{ "type": "repository", "url": "" }` **Website source** — if `homepage` is not null AND it is not just the GitHub repository URL: - Fetch `/llms.txt` to check if it exists - Verify the content is actually docs for this specific package (not a generic/unrelated site) - Add `{ "type": "website", "url": "" }` - If the `llms.txt` fetch succeeded and is valid, include `"llmsTxtUrl": "/llms.txt"` in the source object ### 3. Write the entry - Target path: `registry/npm/.json` - If the file already exists, warn the user before overwriting - Use tab indentation in the JSON output ```json { "sources": [ { "type": "website", "url": "https://example.com/docs", "llmsTxtUrl": "https://example.com/llms.txt" }, { "type": "repository", "url": "https://github.com/org/repo" } ] } ```