{"versions":{"1.4.7":{"name":"downloadjs","main":"download.js","version":"1.4.7","description":"file downloading using client-side javascript","keywords":["files","dataURL","blob","download"],"homepage":"http://danml.com/download.html","license":"MIT","author":{"name":"dandavis","email":"rndme@users.noreply.github.com","url":"http://danml.com/"},"repository":{"type":"git","url":"git+https://github.com/rndme/download.git"},"bugs":{"email":"rndme@users.noreply.github.com"},"files":["download.js","download.min.js"],"npmName":"downloadjs","npmFileMap":[{"basePath":"/","files":["*.js"]}],"gitHead":"31cf0fa096b2171c569e694e2416df2182449d01","_id":"downloadjs@1.4.7","scripts":{},"_shasum":"f69f96f940e0d0553dac291139865a3cd0101e3c","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.4.0","_npmUser":{"name":"anonymous","email":"rndme@users.noreply.github.com"},"maintainers":[{"name":"anonymous","email":"dan@danml.com"}],"dist":{"shasum":"f69f96f940e0d0553dac291139865a3cd0101e3c","size":6602,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/downloadjs/-/downloadjs-1.4.7.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/downloadjs-1.4.7.tgz_1485210771650_0.1952563172671944"},"directories":{},"publish_time":1485210771883,"_cnpm_publish_time":1485210771883,"_hasShrinkwrap":false,"contributors":[]},"1.4.6":{"name":"downloadjs","main":"download.js","version":"1.4.6","description":"file downloading using client-side javascript","keywords":["files","dataURL","blob","download"],"homepage":"http://danml.com/download.html","license":"MIT","author":{"name":"dandavis","email":"rndme@users.noreply.github.com","url":"http://danml.com/"},"repository":{"type":"git","url":"git+https://github.com/rndme/download.git"},"bugs":{"email":"rndme@users.noreply.github.com"},"files":["download.js","download.min.js"],"npmName":"downloadjs","npmFileMap":[{"basePath":"/","files":["*.js"]}],"gitHead":"33d058ede9c6c7828d5e3a0681acfcfdee7c39ca","_id":"downloadjs@1.4.6","scripts":{},"_shasum":"d61b3ca20f89a2e2934830a4f991116d808ddaed","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.4.0","_npmUser":{"name":"anonymous","email":"rndme@users.noreply.github.com"},"maintainers":[{"name":"anonymous","email":"dan@danml.com"}],"dist":{"shasum":"d61b3ca20f89a2e2934830a4f991116d808ddaed","size":6552,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/downloadjs/-/downloadjs-1.4.6.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/downloadjs-1.4.6.tgz_1470945404211_0.2945016452576965"},"directories":{},"publish_time":1470945404450,"_cnpm_publish_time":1470945404450,"_hasShrinkwrap":false,"contributors":[]},"1.4.4":{"name":"downloadjs","main":"download.js","version":"1.4.4","description":"file downloading using client-side javascript","keywords":["files","dataURL","blob","download"],"homepage":"http://danml.com/download.html","license":"CC-BY-4.0","author":{"name":"dandavis","email":"rndme@users.noreply.github.com","url":"http://danml.com/"},"repository":{"type":"git","url":"git+https://github.com/rndme/download.git"},"bugs":{"email":"rndme@users.noreply.github.com"},"files":["download.js","download.min.js"],"npmName":"downloadjs","npmFileMap":[{"basePath":"/","files":["*.js"]}],"gitHead":"415e22eb5ed97cd4fd24c98178a875cd1ef1334d","_id":"downloadjs@1.4.4","scripts":{},"_shasum":"56a653fad4de9f1c87b816b41fa0cebaeed65329","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.4.0","_npmUser":{"name":"anonymous","email":"rndme@users.noreply.github.com"},"maintainers":[{"name":"anonymous","email":"dan@danml.com"}],"dist":{"shasum":"56a653fad4de9f1c87b816b41fa0cebaeed65329","size":9673,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/downloadjs/-/downloadjs-1.4.4.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/downloadjs-1.4.4.tgz_1464126041713_0.4936547614634037"},"directories":{},"publish_time":1464126042962,"_cnpm_publish_time":1464126042962,"_hasShrinkwrap":false,"contributors":[]},"1.4.3":{"name":"downloadjs","main":"download.js","version":"1.4.3","description":"file downloading using client-side javascript","keywords":["files","dataURL","blob","download"],"homepage":"http://danml.com/download.html","license":"CC-BY-4.0","author":{"name":"dandavis","email":"rndme@users.noreply.github.com","url":"http://danml.com/"},"repository":{"type":"git","url":"git+https://github.com/rndme/download.git"},"bugs":{"email":"rndme@users.noreply.github.com"},"files":["download.js","download.min.js"],"npmName":"downloadjs","npmFileMap":[{"basePath":"/","files":["*.js"]}],"gitHead":"4342e029b8c33afa2c97d2276c0666adab7aee0b","_id":"downloadjs@1.4.3","scripts":{},"_shasum":"580d392f4aa1114ac6b511faad7101f95f01fc0b","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.4.0","_npmUser":{"name":"anonymous","email":"rndme@users.noreply.github.com"},"maintainers":[{"name":"anonymous","email":"dan@danml.com"}],"dist":{"shasum":"580d392f4aa1114ac6b511faad7101f95f01fc0b","size":9643,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/downloadjs/-/downloadjs-1.4.3.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/downloadjs-1.4.3.tgz_1463900361227_0.4232258026022464"},"directories":{},"publish_time":1463900362198,"_cnpm_publish_time":1463900362198,"_hasShrinkwrap":false,"contributors":[]},"1.4.2":{"name":"downloadjs","main":"download.js","version":"1.4.2","description":"file downloading using client-side javascript","keywords":["files","dataURL","blob","download"],"homepage":"http://danml.com/download.html","license":"CC-BY-4.0","author":{"name":"dandavis","email":"rndme@users.noreply.github.com","url":"http://danml.com/"},"repository":{"type":"git","url":"git+https://github.com/rndme/download.git"},"bugs":{"email":"rndme@users.noreply.github.com"},"files":["download.js","download.min.js"],"npmName":"downloadjs","npmFileMap":[{"basePath":"/","files":["*.js"]}],"gitHead":"fc870dfa7bc854a4a36bad3fc1803b5b4adf6c1e","_id":"downloadjs@1.4.2","scripts":{},"_shasum":"14b5b79a66c0bdfbd726a9415131eff558fd4566","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.4.0","_npmUser":{"name":"anonymous","email":"rndme@users.noreply.github.com"},"maintainers":[{"name":"anonymous","email":"dan@danml.com"}],"dist":{"shasum":"14b5b79a66c0bdfbd726a9415131eff558fd4566","size":9303,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/downloadjs/-/downloadjs-1.4.2.tgz"},"directories":{},"publish_time":1453921331173,"_cnpm_publish_time":1453921331173,"_hasShrinkwrap":false,"contributors":[]},"1.4.1":{"name":"downloadjs","main":"download.js","version":"1.4.1","description":"file downloading using client-side javascript","keywords":["files","dataURL","blob","download"],"homepage":"http://danml.com/download.html","license":"CC-BY-4.0","author":{"name":"dandavis","email":"rndme@users.noreply.github.com","url":"http://danml.com/"},"repository":{"type":"git","url":"https://github.com/rndme/download.git"},"bugs":{"email":"rndme@users.noreply.github.com"},"files":["download.js","download.min.js"],"npmName":"downloadjs","npmFileMap":[{"basePath":"/","files":["*.js"]}],"gitHead":"784cd313f0059f3934879883e468107eb29715bf","_id":"downloadjs@1.4.1","scripts":{},"_shasum":"e7cd5ad559685481c0c2fe03804ecc7105618662","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"anonymous","email":"rndme@users.noreply.github.com"},"maintainers":[{"name":"anonymous","email":"dan@danml.com"}],"dist":{"shasum":"e7cd5ad559685481c0c2fe03804ecc7105618662","size":4841,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/downloadjs/-/downloadjs-1.4.1.tgz"},"directories":{},"publish_time":1448884826087,"_cnpm_publish_time":1448884826087,"_hasShrinkwrap":false,"contributors":[]},"1.3.1":{"name":"downloadjs","main":"download.js","version":"1.3.1","description":"file downloading using client-side javascript","keywords":["files","dataURL","blob","download"],"homepage":"http://danml.com/download.html","license":"CC-BY-4.0","author":{"name":"dandavis","email":"rndme@users.noreply.github.com","url":"http://danml.com/"},"repository":{"type":"git","url":"https://github.com/rndme/download.git"},"bugs":{"email":"rndme@users.noreply.github.com"},"files":["download.js","download.min.js"],"npmName":"downloadjs","npmFileMap":[{"basePath":"/","files":["*.js"]}],"gitHead":"2b40f956210e76088ba5a184616267d700523887","_id":"downloadjs@1.3.1","scripts":{},"_shasum":"0ac622e38f39d16311717c033e4c86fa6e45b737","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"anonymous","email":"rndme@users.noreply.github.com"},"dist":{"shasum":"0ac622e38f39d16311717c033e4c86fa6e45b737","size":8372,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/downloadjs/-/downloadjs-1.3.1.tgz"},"maintainers":[{"name":"anonymous","email":"dan@danml.com"}],"directories":{},"publish_time":1447036909306,"_cnpm_publish_time":1447036909306,"_hasShrinkwrap":false,"contributors":[]}},"dist-tags":{"latest":"1.4.7"},"name":"downloadjs","time":{"modified":"2023-07-27T21:29:22.482Z","created":"2022-01-26T14:23:30.787Z","1.4.7":"2017-01-23T22:32:51.883Z","1.4.6":"2016-08-11T19:56:44.450Z","1.4.4":"2016-05-24T21:40:42.962Z","1.4.3":"2016-05-22T06:59:22.198Z","1.4.2":"2016-01-27T19:02:11.173Z","1.4.1":"2015-11-30T12:00:26.087Z","1.3.1":"2015-11-09T02:41:49.306Z"},"readme":"# download\n========\n\n## Summary\n---------\nThe download() function is used to trigger a file download from JavaScript. \n\nIt specifies the contents and name of a new file placed in the browser's download directory. The input can be a URL, String, Blob, or Typed Array of data, or via a dataURL representing the file's data as base64 or url-encoded string. No matter the input format, download() saves a file using the specified file name and mime information in the same manner as a server using a Content-Disposition HTTP header.\n\n## Getting and Using\n---------\n\n### Via NPM/Bower \n`npm install downloadjs`  <br />\n`bower install downloadjs`\n\n`require(\"downloadjs\")(data, strFileName, strMimeType);`\n\n### Simple global `download` function via `<script>` include\n    download(data, strFileName, strMimeType);\n\n### Included via AMD\n    require(['path/to/file'], function(download) {\n        download(data, strFileName, strMimeType);\n    });\n\n\n### Parameters\n---------\n* **data** - The Blob, File, String, or dataURL containing the soon-to-be File's contents.\n* **strFileName** - The name of the file to be created. Note that older browsers (like FF3.5, Ch5) don't honor the file name you provide, instead they automatically name the downloaded file.\n* **strMimeType** - The MIME content-type of the file to download. While optional, it helps the browser present friendlier information about the download to the user, encouraging them to accept the download.\n\n\n\n## Example Usage\n---------\n\n\n### Plain Text\n#### text string  -  [live demo](http://pagedemos.com/hw24em95rsfq/output/)\n    download(\"hello world\", \"dlText.txt\", \"text/plain\");\n\n#### text dataURL  -  [live demo](http://pagedemos.com/r9ywm98s6b29/output/)\n    download(\"data:text/plain,hello%20world\", \"dlDataUrlText.txt\", \"text/plain\");\n\n#### text blob  -  [live demo](http://pagedemos.com/ckcah2vp8kza/output/)\n    download(new Blob([\"hello world\"]), \"dlTextBlob.txt\", \"text/plain\");\n\n#### text url - [live demo](http://pagedemos.com/pz6hkyqutjtw/output/)\n    download(\"/robots.txt\");\n\n\n#### text UInt8 Array -  [live demo](http://pagedemos.com/zuyk46wbkktq/output/)\n    var str= \"hello world\",\tarr= new Uint8Array(str.length);\n    str.split(\"\").forEach(function(a,b){\n   \t  arr[b]=a.charCodeAt();\n    });\n\n    download( arr, \"textUInt8Array.txt\", \"text/plain\" );\n\n### HTML\n#### html string -  [live demo](http://pagedemos.com/k7rwq7msu3eb/output/)\n    download(document.documentElement.outerHTML, \"dlHTML.html\", \"text/html\");\n\n#### html Blob -  [live demo](http://pagedemos.com/bxehm2fdf3g4/output/)\n    download(new Blob([\"hello world\".bold()]), \"dlHtmlBlob.html\", \"text/html\");\n\n#### ajax callback -  [live demo](http://pagedemos.com/arr2ym74aw8t/output/)\n(note that callback mode won't work on vanilla ajax or with binary files)\n   \n    $.ajax({\n    \t\turl: \"/download.html\",\n    \t\tsuccess: download.bind(true, \"text/html\", \"dlAjaxCallback.html\")\n    });\n\n\n### Binary Files\n#### image from URL  -  [live demo](http://pagedemos.com/yvvmxbjrwq7u/output/)\n    download(\"/diff6.png\");\n\n#### Image via ajax for custom filename - [live demo](http://pagedemos.com/v2848zfgwrju/output/)\n\tvar x=new XMLHttpRequest();\n\tx.open( \"GET\", \"/diff6.png\" , true);\n\tx.responseType=\"blob\";\n\tx.onload= function(e){download(e.target.response, \"awesomesauce.png\", \"image/png\");};\n\tx.send();\n\n\n## Compatibility\n---------\ndownload.js works with a wide range of devices and browsers.\n\nYou can expect it to work for the vast majority of your users, with some common-sense limits:\n\n* Devices without file systems like iPhone, iPad, Wii, et al. have nowhere to save the file to, sorry.\n* Android support starts at 4.2 for the built-in browser, though chrome 36+ and firefox 20+ on android 2.3+ work well.\n* Devices without Blob support won't be able to download Blobs or TypedArrays\n* Legacy devices (no a[download]) support can only download a few hundred kilobytes of data, and can't give the file a custom name.\n* Devices without window.URL support can only download a couple megabytes of data\n* IE versions of 9 and before are NOT supported because the don't support a[download] or dataURL frame locations.\n\n\n## FAQ\n---------\n\n * `Can I tell when a download is done/canceled?` No.\n * `How can I style the temporary download link?` Define CSS class styles for `.download-js-link`.\n * `What's up with Safari?` I don't know either but pull requests that improve the situation are welcome.\n * `Why is my binary file corrupted?` Likely: an incorrect MIME or using jQuery ajax, which has no bin support.\n * `How big of files work?` Depends, try yourself: [File Echo Demo](http://pagedemos.com/gqs6hbmjcpem/)... I do a 1GB dl routinely on a thinkpad...\n\n\n## Change Log (v4.1)\n---------\n* 2008 :: landed a FF+Chrome compat way of downloading strings to local un-named files, upgraded to use a hidden frame and optional mime\n* 2012 :: added named files via a[download], msSaveBlob() for IE (10+) support, and window.URL support for larger+faster saves than dataURLs\n* 2014 :: added dataURL and Blob Input, bind-toggle arity, and legacy dataURL fallback was improved with force-download mime and base64 support\n* 2015 :: converted to amd/commonJS module with browser-friendly fallback\n* 2015 :: 4.1 added direct URL downloading via a single URL argument.\n* 2016 :: 4.2 added large dataURL support, a more semantic codebase, and hidden temp links\n* 2017 :: added support for empty dataURLs\n* 20XX :: ???? Considering Zip, Tar, and other multi-file outputs, Blob.prototype.download option, and more, stay tuned folks.","users":{}}