This plugin requires Grunt ~0.4.1
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-downloadfile --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-downloadfile');
In your project's Gruntfile, add a section named downloadfile
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
downloadfile: {
files: [
'http://nodejs.org/dist/v0.10.20/node-v0.10.20.tar.gz',
'http://nodejs.org/dist/v0.10.2/node-v0.10.2.tar.gz'
]
},
})
If you want more configuration.
grunt.initConfig({
downloadfile: {
files: [
{
url: 'http://localhost/octopus.png',
port: 9876,
dest: 'tmp',
name: 'image.png'
}
]
},
})
Type: Boolean
Default value: true
Provides you option to download multiple files asynchronous or file after file.
Type: String
Default value: './'
Destination of downloaded files. If folder doesn't exists, grunt will create it.
Type: Number
Default value: 80
Specifies which port will be used for connecting to host.
Type: String
Default value: 'GET'
HTTP method. Only GET is supported now.
Type: Boolean
Default value: true
You can specify to overwrite the file if it already exist.
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
(Nothing yet)