hyperdrive
Advanced tools
Comparing version 3.1.0 to 3.2.0
17
index.js
@@ -72,3 +72,5 @@ var constants = require('constants') | ||
bytesRead: 0, | ||
bytesDownloaded: 0 | ||
bytesDownloaded: 0, | ||
filesRead: 0, | ||
filesDownloaded: 0 | ||
} | ||
@@ -151,3 +153,3 @@ | ||
var dest = join(self.directory, entry.name) | ||
if (process.browser) return cb() | ||
if (process.browser) return done() | ||
@@ -158,10 +160,16 @@ fs.stat(dest, function (_, st) { | ||
// the size check probably isn't nessary here... | ||
if (st && st.size === entry.size) return cb(null) | ||
if (st && st.size === entry.size) return done(null) | ||
// duplicate - just copy it in | ||
mkdirp(path.dirname(dest), function () { | ||
pump(self.createFileStream(entry), fs.createWriteStream(dest), cb) | ||
pump(self.createFileStream(entry), fs.createWriteStream(dest), done) | ||
}) | ||
}) | ||
} | ||
function done (err) { | ||
if (err) return cb(err) | ||
self.stats.filesDownloaded++ | ||
cb(null) | ||
} | ||
} | ||
@@ -325,2 +333,3 @@ } | ||
function append (link, cb) { | ||
if (link) self.stats.filesRead++ | ||
entry.size = size | ||
@@ -327,0 +336,0 @@ entry.link = link |
{ | ||
"name": "hyperdrive", | ||
"version": "3.1.0", | ||
"version": "3.2.0", | ||
"description": "A file sharing network based on rabin file chunking and append only feeds of data verified by merkle trees.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
56472
711