# @bahmutov/parse-github-repo-url 中文文档

规范地址：https://npmcn.com/package/%40bahmutov/parse-github-repo-url/

版本：0\.1\.2
npm 元数据更新时间：2022-06-12T15:01:56.877Z
中文译文更新时间：2026-11-07T23:18:12.903Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40bahmutov/parse-github-repo-url
原文对照：https://npmcn.com/package/%40bahmutov/parse-github-repo-url/?lang=original
项目主页：https://github.com/bahmutov/parse-github-repo-url#readme
源码仓库：https://github.com/bahmutov/parse-github-repo-url

弃用说明：All features were merged back into original parse-github-repo-url

## 关键信息（来自 npm 元数据）

- 模块格式：CommonJS
- TypeScript 类型：未声明
- 运行依赖：0 个
- 首次发布：2015-12-12T22:51:30.842Z
- 最新版本发布：2016-04-13T20:28:20.271Z
- 近 30 天下载量：2067（2026-10-08 至 2026-11-06，npm 官方下载统计）
- 已发布版本数：5（近 12 个月 0 个）

## 中文简介

为用户/项目分析 GitHub URL@version

## 安装

```sh
npm install @bahmutov/parse-github-repo-url
```

也可以使用：`pnpm add @bahmutov/parse-github-repo-url`、`yarn add @bahmutov/parse-github-repo-url`、`bun add @bahmutov/parse-github-repo-url`

## README

# 退出 - 所有功能被重新合并到

# 原始还原 [repo-utils/parse-github-repo-url (英语)](https://github.com/repo-utils/parse-github-repo-url)

# 国家防范机制的“parse-github-repo-url”

# 校对:soup

> 为用户/项目分析 GitHub URL@version

[![NPM info](https://nodei.co/npm/@bahmutov/parse-github-repo-url.png?downloads=true)](https://npmjs.org/package/@bahmutov/parse-github-repo-url)

[![Build](https://secure.travis-ci.org/bahmutov/parse-github-repo-url.png?branch=master)](http://travis-ci.org/#!/bahmutov/parse-github-repo-url) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg) ](https://github.com/semantic-release/semantic-release)[![manpm](https://img.shields.io/badge/manpm-%E2%9C%93-3399ff.svg)](https://github.com/bahmutov/manpm)

注意: 这是克隆 [repo-utils/parse-github-repo-url (英语)](https://github.com/repo-utils/parse-github-repo-url) 和额外的解析器,因为我 [拉动请求](https://github.com/repo-utils/parse-github-repo-url/pull/1) 长期处于困境.

# 特征

解析所有愚蠢的方法,你可以写一个 GitHub URL 在你的该死的 `package.json`。 。 。 . 支持 :

-   `<user>/<repo#<commit>`
-   `git://` 财务报告和审定财务报表 `.git` (单位:千美元) `#commit` 或者说 `@version`
-   `git@` 财务报告和审定财务报表 `https:git@`
-   `www.github.com`
-   `gitlab.<my company name>.com/user/repo.git` 解析
-   所有5种不同的方式,你可以下载一个该死的柏油球/zi球

## API 密码

### \[用户, repo, 版本\] = parse(url)

`version` 可能会 `false`y,一个语义版本,一个承诺,或一个分支等.

```js
var parse = require('@bahmutov/parse-github-repo-url')
parse('component/emitter#1') // => ['component', 'emitter', '1']
```

参见所有不同类型支持的 URL 的测试 .

## 常见问题

### @bahmutov/parse-github-repo-url 是什么？

为用户/项目分析 GitHub URL@version注意：该包已被作者标记为弃用——All features were merged back into original parse-github-repo-url

### 如何安装 @bahmutov/parse-github-repo-url？

在项目目录运行 npm install @bahmutov/parse-github-repo-url，或使用 pnpm add / yarn add / bun add。

### @bahmutov/parse-github-repo-url 支持 TypeScript 吗？

该包的 package\.json 没有声明类型入口。需要类型提示时，可以在 npm 上查找社区维护的 @types/bahmutov\_\_parse-github-repo-url 是否存在。

### @bahmutov/parse-github-repo-url 支持 ESM 还是 CommonJS？

以 CommonJS 形式发布，可以直接 require\(\)；在 ES Module 项目中也可以用 import 引入（Node\.js 会把 module\.exports 作为默认导出）。

### @bahmutov/parse-github-repo-url 可以商用吗？

@bahmutov/parse-github-repo-url 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @bahmutov/parse-github-repo-url 的下载量有多少？

根据 npm 官方下载统计，@bahmutov/parse-github-repo-url 在 2026/10/08 – 2026/11/06 这 30 天内被下载 2,067 次，日均约 69 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @bahmutov/parse-github-repo-url 还在维护吗？

最新版本 0\.1\.2 发布于 2016/04/14（10 年前）；至今共发布 5 个版本，其中过去 12 个月发布了 0 个；首次发布于 2015/12/13。作者已将其标记为弃用，新项目建议寻找替代方案。

