@bahmutov/parse-github-repo-url

中文文档
0.1.2发布于 2016/04/14MITCommonJS零依赖近 30 天下载 2067

Parse a GitHub URL for user/project@version

此软件包已被标记为弃用

All features were merged back into original parse-github-repo-url

原始使用文档

DEPRECATED - all features were merged back into

original repo repo-utils/parse-github-repo-url

available on NPM under "parse-github-repo-url"

@bahmutov/parse-github-repo-url

Parse a GitHub URL for user/project@version

NPM info

Build semantic-release manpm

Note: this is a clone of repo-utils/parse-github-repo-url with additional parsers, since my pull request was in limbo for a very long time.

Features

Parse all the stupid ways you could write a GitHub URL in your damn package.json. Supports:

  • <user>/<repo#<commit>
  • git:// and .git w/ #commit or @version
  • git@ and https:git@
  • www.github.com
  • gitlab.<my company name>.com/user/repo.git parsing
  • All 5 different ways you could download a freaking tarball/zipball

API

[user, repo, version] = parse(url)

version could be falsey, a semantic version, a commit, or a branch, etc.

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

See the tests for all the different types of supported URLs.

版本与发布记录

@bahmutov/parse-github-repo-url 共发布 5 个版本,首次发布于 2015/12/13;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.1.2latest2016/04/1410 年前
0.1.12016/03/2610 年前
0.1.02016/01/0810 年前
0.0.02015/12/1310 年前
0.0.0-semantic-release2015/12/1310 年前

关于 @bahmutov/parse-github-repo-url 的常见问题

@bahmutov/parse-github-repo-url 是什么?

Parse a GitHub URL for user/project@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。作者已将其标记为弃用,新项目建议寻找替代方案。