0.1.1 • Published 6 years ago

sd-gitlab v0.1.1

Weekly downloads
-
License
ISC
Repository
-
Last release
6 years ago

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