Package Exports
- dat-download
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (dat-download) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
dat-download
One-time file downloads via Dat. Download a single file or subdirectory from a dat. Automatically joins the network and handles everything for you.
Example
var datDownload = require('dat-download')
datDownload('dat://778f8d955175c92e4ced5e4f5563f69bfec0c86cc6f670352c457943666fe639/dat.json', process.cwd(), function (err) {
if (err) throw err
console.log('done downloading! thanks')
})Works with DNS-type dat keys too!
var datDownload = require('dat-download')
datDownload('dat://beakerbrowser.com/index.html', process.cwd(), function (err) {
if (err) throw err
console.log('done downloading! thanks')
})Can also download a whole dat:
var datDownload = require('dat-download')
datDownload('dat://beakerbrowser.com/', process.cwd(), function (err) {
if (err) throw err
console.log('done downloading! thanks')
})Install
npm install dat-downloadAPI
datDownload(datPath, [destination], callback)
datPath- dat key with subdirectory or file path. If the whole key is specified, it will download todestination/key.destination- download folder