Sharing data
var dat = Dat()
dat.add(function (repo) {
var writer = repo.archive.createFileWriteStream('hello.txt')
writer.write('world')
writer.end(function () { replicate(repo.key) })
})
Downloading data
var Dat = require('dat-js')
var clone = Dat()
clone.add(key, function (repo) {
repo.archive.readFile('hello.txt', function (err, data) {
console.log(data.toString()) // prints 'world'
})
})
Un logiciel Torrent qui fait tout en P2P ?
A tester !