11# Gitlab
2- ![ version] ( https://img.shields.io/badge/dynamic/json.svg?url=https://raw.githubusercontent.com/NodeSecure/gitlab/master/package.json&query=$.version&label=Version )
3- [ ![ Maintenance] ( https://img.shields.io/badge/Maintained%3F-yes-green.svg )] ( https://github.com/NodeSecure/gitlab/commit-activity )
2+
3+ ![ version] ( https://img.shields.io/badge/dynamic/json.svg?style=for-the-badge&url=https://raw.githubusercontent.com/NodeSecure/gitlab/master/package.json&query=$.version&label=Version )
4+ [ ![ Maintenance] ( https://img.shields.io/badge/Maintained%3F-yes-green.svg?style=for-the-badge )] ( https://github.com/NodeSecure/gitlab/commit-activity )
45[ ![ OpenSSF
5- Scorecard] ( https://api.securityscorecards.dev/projects/github.com/NodeSecure/gitlab/badge )] ( https://api.securityscorecards.dev/projects/github.com/NodeSecure/gitlab )
6- ![ MIT] ( https://img.shields.io/github/license/mashape/apistatus.svg )
7- ![ size] ( https://img.shields.io/github/repo-size/NodeSecure/gitlab )
8- ![ known vulnerabilities] ( https://img.shields.io/snyk/vulnerabilities/github/NodeSecure/gitlab )
9- ![ build] ( https://img.shields.io/github/actions/workflow/status/NodeSecure/gitlab/node.js.yml )
6+ Scorecard] ( https://api.securityscorecards.dev/projects/github.com/NodeSecure/gitlab/badge?style=for-the-badge )] ( https://api.securityscorecards.dev/projects/github.com/NodeSecure/gitlab )
7+ ![ MIT] ( https://img.shields.io/github/license/mashape/apistatus.svg?style=for-the-badge )
8+ ![ size] ( https://img.shields.io/github/repo-size/NodeSecure/gitlab?style=for-the-badge )
9+ ![ known vulnerabilities] ( https://img.shields.io/snyk/vulnerabilities/github/NodeSecure/gitlab?style=for-the-badge )
10+ ![ build] ( https://img.shields.io/github/actions/workflow/status/NodeSecure/gitlab/node.js.yml?style=for-the-badge )
1011
1112Download and (optionaly) extract gitlab repository archive.
1213
1314## Requirements
15+
1416- [ Node.js] ( https://nodejs.org/en/ ) v16 or higher
1517
1618## Getting Started
@@ -24,6 +26,7 @@ $ yarn add @nodesecure/gitlab
2426```
2527
2628## Usage example
29+
2730``` js
2831import * as gitlab from " @nodesecure/gitlab" ;
2932
@@ -33,6 +36,7 @@ console.log(is.location);
3336```
3437
3538## API
39+
3640``` ts
3741export interface DownloadOptions {
3842 /**
@@ -63,7 +67,7 @@ export type ExtractOptions = DownloadOptions & {
6367 * @default true
6468 */
6569 removeArchive? : boolean ;
66- }
70+ };
6771
6872export interface DownloadResult {
6973 /** Archive or repository location on disk */
@@ -76,13 +80,20 @@ export interface DownloadResult {
7680 branch: string ;
7781}
7882
79- export function download(repo : string , options ? : DownloadOptions ): Promise <DownloadResult >;
80- export function downloadAndExtract(repo : string , options ? : ExtractOptions ): Promise <DownloadResult >;
83+ export function download(
84+ repo : string ,
85+ options ? : DownloadOptions
86+ ): Promise <DownloadResult >;
87+ export function downloadAndExtract(
88+ repo : string ,
89+ options ? : ExtractOptions
90+ ): Promise <DownloadResult >;
8191export function setToken(gitlabToken : string ): void ;
8292export function setUrl(gitlabUrl : string | URL ): void ;
8393```
8494
8595### Private repositories
96+
8697To work with private repositories you can either setup a ` GITLAB_TOKEN ` system variable or use ` setToken ` method:
8798
8899``` js
@@ -92,6 +103,7 @@ gitlab.setToken("...");
92103```
93104
94105### Custom gitlab URL
106+
95107To work with a custom gitlab instance you can either setup a ` GITLAB_URL ` system variable or use ` setUrl ` method:
96108
97109``` js
@@ -103,7 +115,9 @@ gitlab.setUrl("...");
103115## Contributors ✨
104116
105117<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
118+
106119[ ![ All Contributors] ( https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square )] ( #contributors- )
120+
107121<!-- ALL-CONTRIBUTORS-BADGE:END -->
108122
109123Thanks goes to these wonderful people ([ emoji key] ( https://allcontributors.org/docs/en/emoji-key ) ):
@@ -125,4 +139,5 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
125139<!-- ALL-CONTRIBUTORS-LIST:END -->
126140
127141## License
142+
128143MIT
0 commit comments