# grunt-get-repo

> Get, extract and copy files fom repository via Grunt task manager.

Latest version **1.0.11** (published 2019-04-01) · 0 weekly downloads

## Install

```sh
npm install grunt-get-repo
pnpm add grunt-get-repo
yarn add grunt-get-repo
bun add grunt-get-repo
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.11 |
| Published | 2019-04-01 |
| First published | 2018-03-13 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.8.0 |
| Dependencies | 5 |
| Unpacked size | 15.8 KB |
| Known vulnerabilities | 0 (+19 in 3 direct dependencies) |
| Install scripts | no |
| Author | Zoltan Kobol |
| Maintainers | npm-solar |
| Keywords | grunt, gruntplugin, ehm |

## Links

- npm: https://www.npmjs.com/package/grunt-get-repo
- npm.io page: https://npm.io/package/grunt-get-repo

## Dependencies (5)

- [tar](https://npm.io/package/tar.md) ~4.4.0
- [async](https://npm.io/package/async.md) ~0.2.10
- [lodash](https://npm.io/package/lodash.md) ~2.4.1
- [request](https://npm.io/package/request.md) ~2.83.0
- [grunt-retro](https://npm.io/package/grunt-retro.md) ~0.7.0

## Recent versions

- 1.0.11 (latest) — 2019-04-01
- 1.0.10 — 2019-01-07
- 1.0.9 — 2019-01-07
- 1.0.8 — 2018-11-20
- 1.0.7 — 2018-11-19
- 1.0.6 — 2018-11-19
- 1.0.5 — 2018-11-14
- 1.0.4 — 2018-10-23
- 1.0.3 — 2018-03-15
- 1.0.2 — 2018-03-13
- 1.0.1 — 2018-03-13

## README

# grunt-get-repo

Download npm packages from Nexus repository  via [grunt][].


## Getting Started
`grunt-get-repo` can be installed via npm: `npm install grunt-get-repo`

Then, add and configure it in your grunt file:

```js
module.exports = function (grunt) {
  // Load in `grunt-get-repo`
  grunt.loadNpmTasks('grunt-get-repo');
};
```


## Documentation
`grunt-get-repo` creates a `grunt` tasks for you  `getRepo`.

#### Global configuration
```js
        getRepo: {
            dependencies: {
                config: {
                        repository: {
                          url: "url-to-nexus-repository/repo-name", // mandatory: url to repository included repository name
                          proxy: "" // optional: proxy, if not set default: ""
                        },
                        extension: "tgz" // optional: package compression, if not set default: tgz
                        dest: "dir-to-download-package" // mandatory: relative path to Gruntfile.js to download package
                    },
                    src {...}
            }
        }

```

#### Package configuration
```js
        getRepo: {
            dependencies: {
              config {...},
                src: [
                  {
                  url: "url-to-nexus-repository/repo-name-1", // optional: url to repository included repository name. If not set use url from config
                  package: "my-package-1", // mandatory: package name
                  version: "1.0.1", // mandatory: version
                      copy: [ //optional : copy extracted files into another directory
                      {
                        src: "file-to-copy-11.js", // mandatory: source filename
                        dest: "another-dir/file-to-copy-11.js" // mandatory: destination
                      },
                      ...
                    ]
                },
                  {...
                }
                  ]
            }
        }
```

#### Examples

#### Sipmple download and extract 

Download and extract file from the repository into directory relative to Gruntfile.js

Creates download and extract files intodiirectory:  my-package/dir-to-download-package

```js
        getRepo: {
            dependencies: {
              config: {
                      repository: {
                        url: "url-to-nexus-repository/repo-name",
                        proxy: ""
                      },
                      dest: "dir-to-download-package"
                  },
              src: [
                {
                package: "my-package",
                version: "1.0.1"
              }
                ]
            }
          }
```
#### Download, extract and copy files

Download and extract file from the repository into directory relative to Gruntfile.js

Creates download and extract files fron dest directory into another directory: 

```js
        getRepo: {
            dependencies: {
              config: {
                      repository: {
                        url: "url-to-nexus-repository/repo-name",
                        proxy: ""
                      },
                      dest: "dir-to-download-package"
                  },
              src: [
                {
                package: "my-package",
                version: "1.0.1",
                    copy: [
                    {src: "file-to-copy-1.js", dest: "another-dir/file-to-copy-1.js"},
                    {src: "file-to-copy-2.js", dest: "another-dir/file-to-copy-2.js"}
                  ]
              }
                ]
            }
          }
```
#### Download, extract and copy multiple packages

```js
        getRepo: {
            dependencies: {
              config: {
                      repository: {
                        url: "url-to-nexus-repository/repo-name",
                        proxy: ""
                      },
                      dest: "dir-to-download-package"
                  },
              src: [
                {
                package: "my-package-1",
                version: "1.0.1",
                    copy: [
                    {src: "file-to-copy-11.js", dest: "another-dir/file-to-copy-11.js"},
                    {src: "file-to-copy-12.js", dest: "another-dir/file-to-copy-12.js"}
                  ]
              },
                              {
                package: "my-package-2",
                version: "1.0.1",
                    copy: [
                    {src: "file-to-copy-21.js", dest: "another-dir/file-to-copy-21.js"},
                    {src: "file-to-copy-22.js", dest: "another-dir/file-to-copy-22.js"}
                  ]
              }
                ]
            }
          }
```

#### Download, extract and copy multiple packages from different url's

```js
        getRepo: {
            dependencies: {
              config: {
                      repository: {
                        proxy: ""
                      },
                      dest: "dir-to-download-package"
                  },
              src: [
                {
                url: "url-to-nexus-repository/repo-name-1",
                package: "my-package-1",
                version: "1.0.1",
                    copy: [
                    {src: "file-to-copy-11.js", dest: "another-dir/file-to-copy-11.js"},
                    {src: "file-to-copy-12.js", dest: "another-dir/file-to-copy-12.js"}
                  ]
              },
                {
                url: "url-to-nexus-repository/repo-name",
                package: "my-package-2",
                version: "1.0.1",
                    copy: [
                    {src: "file-to-copy-21.js", dest: "another-dir/file-to-copy-21.js"},
                    {src: "file-to-copy-22.js", dest: "another-dir/file-to-copy-22.js"}
                  ]
              }
                ]
            }
          }
```

Note: you can also set  more tasks (getRepo:dependencies1, getRepo:dependencies2) as usual for grunt tasks

---
_Source: https://npm.io/package/grunt-get-repo · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
