Gitlab

Download and (optionaly) extract gitlab repository archive.
Requirements
Getting Started
This package is available in the Node Package Repository and can be easily installed with npm or yarn.
$ npm i @nodesecure/gitlab
$ yarn add @nodesecure/gitlab
Usage example
import * as gitlab from "@nodesecure/gitlab";
const is = await gitlab.download("NodeSecure.utils");
console.log(is.location);
API
export interface DownloadOptions {
dest?: string;
branch?: string | null;
token?: string;
}
export type ExtractOptions = DownloadOptions & {
removeArchive?: boolean;
}
export interface DownloadResult {
location: string;
repository: string;
organization: string;
branch: string;
}
export function download(repo: string, options?: DownloadOptions): Promise<DownloadResult>;
export function downloadAndExtract(repo: string, options?: ExtractOptions): Promise<DownloadResult>;
export function setToken(gitlabToken: string): void;
export function setUrl(gitlabUrl: string | URL): void;
Private repositories
To work with private repositories you can either setup a GITLAB_TOKEN system variable or use setToken method:
import * as gitlab from "@nodesecure/gitlab";
gitlab.setToken("...");
Custom gitlab URL
To work with a custom gitlab instance you can either setup a GITLAB_URL system variable or use setUrl method:
import * as gitlab from "@nodesecure/gitlab";
gitlab.setUrl("...");
Contributors ✨

Thanks goes to these wonderful people (emoji key):
License
MIT