fs-blob-store
Advanced tools
Comparing version 3.0.2 to 4.0.0
10
index.js
@@ -20,3 +20,3 @@ var fs = require('fs') | ||
var Writer = function(dir, algo, init) { | ||
this.hash = null | ||
this.key = null | ||
this.length = 0 | ||
@@ -38,3 +38,3 @@ this.destroyed = false | ||
var self = this | ||
var hash = this.hash = this._digest.digest('hex') | ||
var hash = this.key = this._digest.digest('hex') | ||
var dir = path.join(this._directory, hash.slice(0, 2)) | ||
@@ -125,7 +125,7 @@ | ||
that.createReadStream = function(opts) { | ||
return fs.createReadStream(toPath(dir, opts.hash)) | ||
return fs.createReadStream(toPath(dir, opts.key)) | ||
} | ||
that.exists = function(opts, cb) { | ||
fs.stat(toPath(dir, opts.hash), function(err, stat) { | ||
fs.stat(toPath(dir, opts.key), function(err, stat) { | ||
if (err && err.code === 'ENOENT') return cb(null, false) | ||
@@ -139,3 +139,3 @@ if (err) return cb(err) | ||
if (!cb) cb = noop | ||
fs.unlink(toPath(dir, opts.hash), function(err) { | ||
fs.unlink(toPath(dir, opts.key), function(err) { | ||
if (err && err.code === 'ENOENT') return cb(null, false) | ||
@@ -142,0 +142,0 @@ if (err) return cb(err) |
{ | ||
"name": "fs-blob-store", | ||
"version": "3.0.2", | ||
"version": "4.0.0", | ||
"description": "Streamable content addressable blob object store that is streams2 and implements the blob store interface on top of the fs module", | ||
@@ -12,3 +12,3 @@ "main": "index.js", | ||
"devDependencies": { | ||
"abstract-blob-store": "^1.1.1", | ||
"abstract-blob-store": "^2.0.1", | ||
"concat-stream": "^1.4.6", | ||
@@ -15,0 +15,0 @@ "rimraf": "^2.2.8", |
# fs-blob-store | ||
Streamable content addressable blob object store that is streams2 and implements the blob store interface on top of the fs module. | ||
Streamable content addressable [blob](http://en.wikipedia.org/wiki/Binary_large_object) object store that is streams2 and implements the blob store interface on top of the fs module. | ||
@@ -5,0 +5,0 @@ Conforms to the [abstract-blob-store](https://github.com/maxogden/abstract-blob-store) API and passes it's test suite. |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
7631
0