{ "name": "grunt-curl", "description": "Download files from the internet via grunt.", "version": "1.1.1", "homepage": "https://github.com/twolfson/grunt-curl", "author": { "name": "Todd Wolfson", "email": "todd@twolfson.com", "url": "http://twolfson.com/" }, "repository": { "type": "git", "url": "git://github.com/twolfson/grunt-curl.git" }, "bugs": { "url": "https://github.com/twolfson/grunt-curl/issues" }, "licenses": [ { "type": "MIT", "url": "https://github.com/twolfson/grunt-curl/blob/master/LICENSE-MIT" } ], "main": "grunt.js", "bin": { "grunt-curl": "bin/grunt-curl" }, "engines": { "node": "*" }, "scripts": { "test": "doubleshot" }, "dependencies": { "request": "~2.21.0", "grunt-retro": "~0.6.0" }, "_devDependencies": { "grunt": "~0.3.17", "doubleshot": "~1.0.1", "chai": "~1.5.0", "grunt-contrib-clean": "~0.3.2" }, "devDependencies": { "grunt": "~0.4.0", "doubleshot": "~1.0.1", "chai": "~1.5.0", "grunt-contrib-clean": "~0.4.1" }, "keywords": [ "gruntplugin", "grunt", "curl", "download", "request", "file", "url", "uri" ], "readme": "# grunt-curl [![Donate on Gittip](http://badgr.co/gittip/twolfson.png)](https://www.gittip.com/twolfson/)\n\nDownload files from the internet via grunt.\n\n## Getting Started\nInstall this grunt plugin next to your project's [grunt.js gruntfile][getting_started] with: `npm install grunt-curl`\n\nThen add this line to your project's `grunt.js` gruntfile:\n\n```javascript\ngrunt.loadNpmTasks('grunt-curl');\n```\n\n[grunt]: http://gruntjs.com/\n[getting_started]: https://github.com/gruntjs/grunt/blob/master/docs/getting_started.md\n\n## Documentation\n`grunt-curl` retrieves data via [request][request]'s GET method and writes it to file.\n\nWe register two grunt tasks\n```js\ngrunt.initConfig({\n // Grab single files\n curl: {\n // Short format (dest: src)\n 'location/to/download/file.js': 'http://files.com/path/to/file.js',\n\n // Long format\n long: {\n src: 'http://files.com/path/to/file.js',\n dest: 'location/to/download/file.js'\n }\n },\n // Grab multiple files\n 'curl-dir': {\n // Short format (dest folder: [src1, src2])\n // These will be saved as 'location/to/save/files/file1.js'\n // and 'location/to/save/files/file2.js'\n 'location/to/save/files': [\n 'http://files.com/path/to/file1.js',\n 'http://generic.com/scripts/file2.js'\n ],\n\n // Long format\n long: {\n src: [\n 'http://files.com/path/to/file1.js',\n 'http://files.com/path/to/file2.js'\n ],\n dest: 'location/to/save/files'\n },\n\n // src files will expand to same file1.js and file2.js as long format\n braceExpansion: {\n src: ['http://files.com/path/to/{file1,file2}.js'],\n dest: 'location/to/save/files'\n },\n\n // Custom filepaths\n // This will save file1.js to location/to/save/files/path/to/file1.js\n // and file2.js to location/to/save/files/scripts/file2.js\n customFilepaths: {\n src: [\n 'http://files.com/path/to/file1.js',\n 'http://generic.com/scripts/file2.js'\n ],\n router: function (url) {\n return url.replace('http://files.com/', '').replace('http://generic.com/', '');\n },\n dest: 'location/to/save/files'\n }\n }\n}):\n```\n\nand a grunt helper\n```js\ngrunt.helper('curl', url, function handleData (err, content) {\n // Handle error and use content\n});\n```\n\n[request]: https://github.com/mikeal/request\n\n## Contributing\nIn lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint your code using [grunt][grunt] and test via `npm test`.\n\n## License\nCopyright (c) 2013 Todd Wolfson\nLicensed under the MIT license.\n", "readmeFilename": "README.md", "_id": "grunt-curl@1.1.1", "dist": { "shasum": "b5f96d3caafa990205bce9a9d1e7bb612f08ddcd" }, "_from": "grunt-curl@~1.1.0", "_resolved": "https://registry.npmjs.org/grunt-curl/-/grunt-curl-1.1.1.tgz" }