iyowei / get-git-repo-url

异步获取指定 Git 项目远程仓库地址。

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

getGitRepoUrl(path, callback)

异步 获取指定 Git 项目远程仓库地址。

使用

  • path {String} 工作路径,默认: ""
  • callback {Function},
    • err {Error} 错误信息,没发生错误,则返回 false
    • url {String | Null} 远程 Git 仓库地址。
import getGitRepoUrl from '@iyowei/get-git-repo-url';

getGitRepoUrl(process.cwd(), (err, url) => {
  if (!err) {
    console.log(url);
    return;
  }

  throw err;
});

安装

Node version

# Pnpm
pnpm add @iyowei/get-git-repo-url

# yarn
yarn add @iyowei/get-git-repo-url

# npm
npm add @iyowei/get-git-repo-url

相关

参与贡献

PRs Welcome

About

异步获取指定 Git 项目远程仓库地址。

License:MIT License


Languages

Language:JavaScript 100.0%