Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fallenmax/gitlab-tool
A (really) thin Gitlab API wrapper for node.js
https://github.com/fallenmax/gitlab-tool
Last synced: 11 days ago
JSON representation
A (really) thin Gitlab API wrapper for node.js
- Host: GitHub
- URL: https://github.com/fallenmax/gitlab-tool
- Owner: FallenMax
- Created: 2016-11-29T11:33:24.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-01-24T02:18:18.000Z (about 8 years ago)
- Last Synced: 2024-11-20T19:34:04.549Z (2 months ago)
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/gitlab-tool
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Gitlab-Tool
A (really) thin [Gitlab API](https://docs.gitlab.com/ee/api/README.html) wrapper for node.js
## Installation
`npm install --save 'gitlab-tool'`
## Usage
```javascript
const gitlab = require('gitlab-tool')({
baseUri: 'http://gitlab.example.com/api/v3', // Gitlab API uri
privateToken: 'MY_PRIVATE_TOKEN', // Profile Settings -> Account -> Private Token
debug: false // need some debug log?
})const PROJECT_ID = 42 // list all projects: https://docs.gitlab.com/ee/api/projects.html#list-all-projects
const ASSIGNEE_ID = 93 // list all users: https://docs.gitlab.com/ee/api/users.html#list-users// Create a merge request using official API:
// https://docs.gitlab.com/ee/api/merge_requests.html#create-mr
gitlab.post(`/projects/${PROJECT_ID}/merge_requests`, {
source_branch: 'my-feature',
target_branch: 'master',
assignee_id: ASSIGNEE_ID,
title: 'This is a merge request',
description: 'some description'
})
.then(result => console.log(result))
```## Documentation
[GitLab API](https://docs.gitlab.com/ee/api/README.html)