{"id":19515221,"url":"https://github.com/krmax44/normalize-repo","last_synced_at":"2025-06-10T16:32:34.173Z","repository":{"id":35055029,"uuid":"201296481","full_name":"krmax44/normalize-repo","owner":"krmax44","description":"Normalizes the repository value of package.json.","archived":false,"fork":false,"pushed_at":"2022-02-12T11:37:18.000Z","size":2010,"stargazers_count":0,"open_issues_count":8,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-22T11:50:02.812Z","etag":null,"topics":["package-json"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/krmax44.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-08T16:26:32.000Z","updated_at":"2020-01-07T04:54:35.000Z","dependencies_parsed_at":"2022-08-08T04:15:30.946Z","dependency_job_id":null,"html_url":"https://github.com/krmax44/normalize-repo","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krmax44%2Fnormalize-repo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krmax44%2Fnormalize-repo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krmax44%2Fnormalize-repo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krmax44%2Fnormalize-repo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/krmax44","download_url":"https://codeload.github.com/krmax44/normalize-repo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krmax44%2Fnormalize-repo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259110411,"owners_count":22806715,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["package-json"],"created_at":"2024-11-10T23:39:03.669Z","updated_at":"2025-06-10T16:32:34.139Z","avatar_url":"https://github.com/krmax44.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Normalize Repo\n\n[![Build Status](https://travis-ci.com/krmax44/normalize-repo.svg?branch=master)](https://travis-ci.com/krmax44/normalize-repo)\n![npm bundle size](https://img.shields.io/bundlephobia/min/normalize-repo?label=size)\n![npm version](https://img.shields.io/npm/v/normalize-repo)\n\nNormalizes the `repository` object or string you typically find in `package.json`. It adheres to the [specification](https://docs.npmjs.com/files/package.json#repository) and can parse everything you can also use as a value for `repository`.\n\n## Installation\n\n```bash\nyarn add normalize-repo\n```\n\n## Examples\n\nAll values that `repository`\n\n```js\nconst normalizeRepo = require('normalize-repo');\n\nnormalizeRepo('github:krmax44/normalize-repo')\n\n// output:\n{\n  url: 'https://github.com/krmax44/normalize-repo.git',\n  shortcut: 'github:krmax44/normalize-repo',\n  provider: 'github',\n  owner: 'krmax44',\n  name: 'normalize-repo'\n}\n```\n\nYou can also pass an object:\n\n```js\nnormalizeRepo({ url: 'https://github.com/krmax44/normalize-repo.git' });\n```\n\nA malformatted and incompliant input will throw an error:\n\n```js\ntry {\n  // will throw an error, as only shortcut strings are allowed\n  normalizeRepo('https://github.com/krmax44/normalize-repo.git');\n} catch (error) {\n  console.log(error);\n}\n```\n\n**Note**: Only Github, Gitlab, Github Gist and Bitbucket repositories will return `shortcut`, `provider`, `owner` and `name` values.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrmax44%2Fnormalize-repo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrmax44%2Fnormalize-repo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrmax44%2Fnormalize-repo/lists"}