Home

Awesome

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.

npm travis standard

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-download

API

datDownload(datPath, [destination], callback)

License

MIT