Socket
Book a DemoInstallSign in
Socket

@nodesecure/gitlab

Package Overview
Dependencies
Maintainers
5
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nodesecure/gitlab

Download and extract gitlab repository

Source
npmnpm
Version
2.0.0
Version published
Weekly downloads
3
Maintainers
5
Weekly downloads
 
Created
Source

Gitlab

version Maintenance OpenSSF
Scorecard MIT build

Download and (optionaly) extract gitlab repository archive.

Requirements

  • Node.js v18 or higher

Getting Started

This package is available in the Node Package Repository and can be easily installed with npm or yarn.

$ npm i @nodesecure/gitlab
# or
$ yarn add @nodesecure/gitlab

Usage example

import * as gitlab from "@nodesecure/gitlab";

// Note: repository can be either namespace path or repository ID
const result = await gitlab.download(
  "NodeSecure.utils"
);
console.log(result);

API

Both download and downloadAndExtract functions use the same set of options.

interface DownloadOptions {
  /**
   * The destination (location) to extract the tar.gz
   *
   * @default process.cwd()
   */
  dest?: string;
  /**
   * The default gitlab branch name (master, main ...).
   * By default it fetch the "default" gitlab branch.
   *
   * @default null
   */
  branch?: string | null;
  /**
   * Authentication token for private repositories
   *
   * @default process.env.GITLAB_TOKEN
   */
  token?: string;
  /**
   * @default https://gitlab.com/api/v4/projects/
   */
  gitlab?: string;
}

download(repository: string, options?: DownloadOptions): Promise< DownloadResult >

Download the tar.gz archive of the GIT repository.

interface DownloadResult {
  /** Archive or repository location on disk */
  location: string;
  /** Gitlab repository name */
  repository: string;
  /** Gitlab organization name */
  organization: string;
  /** Gitlab branch name */
  branch: string;
}

downloadAndExtract(repository: string, options?: DownloadExtractOptions): Promise< DownloadResult >

Use download but extract the tar.gz archive.

interface DownloadExtractOptions extends DownloadOptions {
  /**
   * Remove the tar.gz archive after a succesfull extraction
   *
   * @default true
   */
  removeArchive?: boolean;
}

Contributors ✨

All Contributors

Thanks goes to these wonderful people (emoji key):

Gentilhomme
Gentilhomme

💻 📖 👀 🛡️ 🐛
Haze
Haze

💻
Alexandre Malaj
Alexandre Malaj

💻 📖
Kouadio Fabrice Nguessan
Kouadio Fabrice Nguessan

🚧
FredGuiou
FredGuiou

🚧

License

MIT

Keywords

NodeSecure

FAQs

Package last updated on 15 Aug 2024

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