
Security News
Django Joins curl in Pushing Back on AI Slop Security Reports
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
The gitlab npm package provides a comprehensive interface to interact with the GitLab API, allowing users to manage projects, repositories, issues, merge requests, and more programmatically.
Project Management
This feature allows you to create and manage projects within GitLab. The code sample demonstrates how to create a new project using the GitLab API.
const { Gitlab } = require('gitlab');
const api = new Gitlab({ token: 'your_access_token' });
async function createProject() {
const project = await api.Projects.create({ name: 'new-project' });
console.log(project);
}
createProject();
Issue Tracking
This feature allows you to create and manage issues within GitLab projects. The code sample demonstrates how to create a new issue in a specific project.
const { Gitlab } = require('gitlab');
const api = new Gitlab({ token: 'your_access_token' });
async function createIssue() {
const issue = await api.Issues.create(1, { title: 'New Issue', description: 'Issue description' });
console.log(issue);
}
createIssue();
Merge Requests
This feature allows you to create and manage merge requests within GitLab projects. The code sample demonstrates how to create a new merge request.
const { Gitlab } = require('gitlab');
const api = new Gitlab({ token: 'your_access_token' });
async function createMergeRequest() {
const mergeRequest = await api.MergeRequests.create(1, { source_branch: 'feature-branch', target_branch: 'main', title: 'New Merge Request' });
console.log(mergeRequest);
}
createMergeRequest();
Repository Management
This feature allows you to manage repositories, including listing files, creating branches, and more. The code sample demonstrates how to list files in a repository.
const { Gitlab } = require('gitlab');
const api = new Gitlab({ token: 'your_access_token' });
async function listRepositoryFiles() {
const files = await api.Repositories.tree(1, { path: '', ref: 'main' });
console.log(files);
}
listRepositoryFiles();
node-gitlab is another package that provides a wrapper for the GitLab API. It offers similar functionalities to the gitlab package, such as project management, issue tracking, and repository management. However, it may have a different API design and feature set.
node-gitlab-api is another alternative for interacting with the GitLab API. It offers functionalities similar to the gitlab package, such as managing projects, issues, and repositories. It is designed to be simple and easy to use, making it a good choice for basic GitLab API interactions.
GitLab API Nodejs library. It wraps the HTTP api library described here.
Maintained by Manfred Touron and Dave Irvine
# Install from npm
npm install gitlab
URL to your GitLab instance should not include /api/v3
path.
# Connection
gitlab = (require 'gitlab')
url: 'http://example.com'
token: 'abcdefghij123456'
# Listing users
gitlab.users.all (users) ->
console.log "##{user.id}: #{user.email}, #{user.name}, #{user.created_at}" for user in users
# Listing projects
gitlab.projects.all (projects) ->
for project in projects
console.log "##{project.id}: #{project.name}, path: #{project.path}, default_branch: #{project.default_branch}, private: #{project.private}, owner: #{project.owner.name} (#{project.owner.email}), date: #{project.created_at}"
// Connection
var gitlab = require('gitlab')({
url: 'http://example.com',
token: 'abcdefghij123456'
});
// Listing users
gitlab.users.all(function(users) {
for (var i = 0; i < users.length; i++) {
console.log("#" + users[i].id + ": " + users[i].email + ", " + users[i].name + ", " + users[i].created_at);
}
});
// Listing projects
gitlab.projects.all(function(projects) {
for (var i = 0; i < projects.length; i++) {
console.log("#" + projects[i].id + ": " + projects[i].name + ", path: " + projects[i].path + ", default_branch: " + projects[i].default_branch + ", private: " + projects[i]["private"] + ", owner: " + projects[i].owner.name + " (" + projects[i].owner.email + "), date: " + projects[i].created_at);
}
});
See Examples directory for more examples
Edit the Coffee-Script files in src
, then build them using cake build
.
Use cake watch
to build files continuously while developing.
Check out cli-gitlab
MIT
Project.edit
Projects.create_for_user
Thanks to @peteward44, @Sewdn, @ryansouthern and @geeeeeeeeek
Groups.create
, Groups.addProject
and Groups.search
methodsProjects.remove
and Projects.search
methodsUserKeys
resourceUsers.search
methodProjectMielstones.get
to ProjectMilestones.all
.all()
methodsThanks to @huhgawz, @ConnorWeng, @langma, @spruce, @stevenorman and @nogs
21.6.0 (Tue Jun 16 2020)
@gitbeaker/browser
, @gitbeaker/cli
, @gitbeaker/core
, @gitbeaker/node
, @gitbeaker/requester-utils
FAQs
Full NodeJS implementation of the GitLab API. Supports Promises, Async/Await.
The npm package gitlab receives a total of 210,140 weekly downloads. As such, gitlab popularity was classified as popular.
We found that gitlab demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.