@fxs0819/git-helper
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

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

Package Sidebar

Install

npm i @fxs0819/git-helper

Weekly Downloads

6

Version

1.0.0

License

ISC

Unpacked Size

8.74 kB

Total Files

5

Last publish

Collaborators

  • fxs0819
  • frozen.f