Skip to content

iyowei/get-git-repo-url

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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