npm.io
1.0.1 • Published 4 years ago

@iyowei/get-git-repo-url

Licence
MIT
Version
1.0.1
Deps
0
Size
3 kB
Vulns
0
Weekly
0

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

Keywords