@fxs0819/git-helper
v1.0.0
Published
基于以下载gitlab文件为核心封装的git api 工具
Downloads
15
Readme
git-helper
git api简单封装,目前仅支持下载文件.
Installation
Install with npm
npm install @fxs0819/git-helper
Examples
/** github */
const h = new GitHelper({
provider: 'github',
repository: 'https://github.com/xxx.git',
branch: 'master',
config: {
userName: 'xxx', // Github Basic Auth Username
password: 'xxx' // Github Basic Auth Password
}
});
const f = await h.readFile('package.json');
// 或
const h = new GitHelper({
provider: 'github',
repository: 'https://github.com/xxx.git',
branch: 'master',
config: {
oauth2Token: 'xxx' // Github OAuth2 Token
}
});
const f = await h.readFile('package.json');
/** gitlab */
const h = new GitHelper({
provider: 'gitlab',
repository: 'https://gitlab.com/xx.git',
branch: 'master',
config: {
privateToken: 'xxx' // Gitlab Personal Access Tokens
}
});
const f = await h.readFile('package.json');
License
MIT