$ npm install --save mvn-artifact-download
import download from 'mvn-artifact-download';
download('org.apache.commons:commons-lang3:3.4');
// Promise that resolves to destination filename
download({
groupId: 'org.apache.commons',
artifactId: 'commons-lang3',
version: '3.4',
});
// Promise that resolves to destination filename
download('org.apache.commons:commons-lang3:3.4', '/path/to/destination/dir');
// Promise that resolves to destination filename
download(
'org.apache.commons:commons-lang3:3.4',
null,
'http://alternative.repo'
);
// Promise that resolves to destination filename
download(
'org.apache.commons:commons-lang3:3.4',
null,
'http://alternative.repo',
{ timout: 1000 } // with optional timeout
);
// Promise that resolves to destination filename
Downloads an artifact from the repository
Type: string | Artifact
Type: string
Default: process.cwd()
Type: string
An optional object containing
Attribute: timeout number
req/res timeout in ms
Attribute: agent http.Agent
allows custom proxy, certificate etc.
MIT © Sigurd Fosseng