sd-gitlab

0.1.1 • Public • Published

gitlab

gitlab api 接口调用服务

Install

yarn add sd-gitlab

Use

Initialization

const GitLab = require('gitlab-api')

const gitLab = new GitLab({
  baseUrl: 'https://example.com',
  // gitlab个人令牌 https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html
  privateToken: '', 
  expires: 1 // 缓存天数
})

API

getAllProjects(options)

获取所有项目列表

options
参数 类型 描述 示例
pick Array 获取的属性列表 ['name']
filter Object 过滤条件,对象值为正则 {name: /regex/}
Example
gitLab.getAllProjects({
  pick: ['name', 'path_with_namespace'],
  filter: {
    path_with_namespace: /^namespace/
  }
}).then(data => {
  console.log(data)
})

Readme

Keywords

none

Package Sidebar

Install

npm i sd-gitlab

Weekly Downloads

1

Version

0.1.1

License

ISC

Unpacked Size

246 kB

Total Files

15

Last publish

Collaborators

  • shuidifed