🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

gitlab

Package Overview
Dependencies
Maintainers
2
Versions
169
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gitlab

GitLab API Nodejs library.

1.6.0
Source
npm
Version published
Weekly downloads
246K
-3.52%
Maintainers
2
Weekly downloads
 
Created

What is gitlab?

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.

What are gitlab's main functionalities?

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();

Other packages similar to gitlab

Keywords

gitlab

FAQs

Package last updated on 10 May 2016

Did you know?

Socket

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.

Install

Related posts