https://github.com/eyolas/gitlab-download
Download and extract a Gitlab repository from node.
https://github.com/eyolas/gitlab-download
Last synced: 10 months ago
JSON representation
Download and extract a Gitlab repository from node.
- Host: GitHub
- URL: https://github.com/eyolas/gitlab-download
- Owner: eyolas
- License: wtfpl
- Created: 2015-08-21T06:45:55.000Z (almost 11 years ago)
- Default Branch: develop
- Last Pushed: 2022-12-05T02:30:23.000Z (over 3 years ago)
- Last Synced: 2024-04-26T05:03:08.336Z (about 2 years ago)
- Language: TypeScript
- Size: 129 KB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Node.js - gitlab-download
================
Easily download Gitlab repos without any external dependencies such as Git, Tar, Unzip, etc.
Installation
------------
npm install gitlab-download
Usage
-----
### instanciate new GitlabDownload(gitlabUrl, token)
Instanciate gitlab-download
```js
var GitlabDownload = require('gitlab-download').default;
var gitlab = new GitlabDownload('https://mysgitlab.com', 'aze12233zae');
```
- **gitlabUrl**:
- a Github URL string such as `https://mysgitlab.com`
- **token**: You private token.
### download(params)
Downloads the latest copy of some Gitlab reference (branch, tag, or commit), or the `master` branch by default.
- **params**: Object of param:
- **remote**: path of project (sample:`eyolas/gitlab-download`) (required)
- **dest**: The output directory.
- **ref**: Gitlab reference (branch, tag, or commit). Default : `master`
- **downloadOptions**: Options for [download api]()
Returns both a `Promise` and a [Duplex stream](https://nodejs.org/api/stream.html#stream_class_stream_duplex) with [additional events](https://github.com/sindresorhus/got#streams-1).
Example:
```javascript
var GitlabDownload = require('gitlab-download');
var gitlab = new GitlabDownload('https://mysgitlab.com', 'aze12233zae');
gitlab.download({remote: 'eyolas/gitlab-download'});
```
License
-------
(WTFPL License)