{"_id":"hyperdrive-duplicate","_rev":"7-f402e2bb3904fb27da3cdb2ca2e3c902","name":"hyperdrive-duplicate","description":"Compare file contents for a file in hyperdrive and on the filesystem.","dist-tags":{"latest":"3.0.0"},"versions":{"1.0.0":{"name":"hyperdrive-duplicate","version":"1.0.0","description":"Check if a file is the same as an entry in hyperdrive.","main":"index.js","scripts":{"test":"standard"},"repository":{"type":"git","url":"git+https://github.com/joehand/hyperdrive-duplicate.git"},"author":{"name":"Joe Hand","email":"joe@hand.email","url":"https://joeahand.com/"},"license":"MIT","bugs":{"url":"https://github.com/joehand/hyperdrive-duplicate/issues"},"homepage":"https://github.com/joehand/hyperdrive-duplicate#readme","dependencies":{"stream-equal":"^0.1.9"},"gitHead":"a7b5fa64e63d3b0659b540aae7e5405d06ecd92f","_id":"hyperdrive-duplicate@1.0.0","_shasum":"6adf7b574d73b619b3c4c6880993a0d0686297a5","_from":".","_npmVersion":"3.10.6","_nodeVersion":"6.5.0","_npmUser":{"name":"jhand","email":"joe@hand.email"},"dist":{"shasum":"6adf7b574d73b619b3c4c6880993a0d0686297a5","tarball":"https://registry.npmjs.org/hyperdrive-duplicate/-/hyperdrive-duplicate-1.0.0.tgz","integrity":"sha512-JfHiSmXNwlQY1pCKb04VqTuvJCwfoaF/HDx8NzVudw336wlGsoO/qK9S7OSokriG9bo7AhIpsE8nFYU9Q7f37Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDD0orWlPp8hMBK6CZvmSdkoyNGhuTXspgf4R+X9VfqmAIhAKAJG+wAgkci42z+izg7ZNsZGZfP90oUqQOFWAQS0I98"}]},"maintainers":[{"name":"jhand","email":"joe@hand.email"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/hyperdrive-duplicate-1.0.0.tgz_1478567947824_0.20317681692540646"}},"2.0.0":{"name":"hyperdrive-duplicate","version":"2.0.0","description":"Compare file contents for a file in hyperdrive and on the filesystem.","main":"index.js","scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/joehand/hyperdrive-duplicate.git"},"author":{"name":"Joe Hand","email":"joe@hand.email","url":"https://joeahand.com/"},"license":"MIT","bugs":{"url":"https://github.com/joehand/hyperdrive-duplicate/issues"},"homepage":"https://github.com/joehand/hyperdrive-duplicate#readme","dependencies":{"stream-equal":"^0.1.9"},"peerDependencies":{"hyperdrive":"^8.0.0"},"devDependencies":{"hyperdrive":"^8.0.0","random-access-memory":"^2.3.0","standard":"^9.0.2","tape":"^4.6.3"},"gitHead":"bb34c94a626fa133eb8a1b92c7d56dc22e4b0947","_id":"hyperdrive-duplicate@2.0.0","_shasum":"8db112094b9b158eb0ca5a7a81b09a755bdf303c","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"jhand","email":"joe@hand.email"},"dist":{"shasum":"8db112094b9b158eb0ca5a7a81b09a755bdf303c","tarball":"https://registry.npmjs.org/hyperdrive-duplicate/-/hyperdrive-duplicate-2.0.0.tgz","integrity":"sha512-D/hY19RBzlPWKrtF9mnx5vbrnOBX5drIvHAKkxBBFjKNugOl7vlFeQQQX05juwB1A06Z07ZexyGkmfvvdLiQMA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD/XG0uyKdDwNXW5nGk7rAtd9hk985Hg9gMZywVh72wsQIgeDz1zTpOu98sMlKhBLlXEvGjFWRr6syOesvxY+PynEo="}]},"maintainers":[{"name":"jhand","email":"joe@hand.email"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/hyperdrive-duplicate-2.0.0.tgz_1491437314739_0.16677633789367974"}},"3.0.0":{"name":"hyperdrive-duplicate","version":"3.0.0","description":"Compare file contents for a file in hyperdrive and on the filesystem.","main":"index.js","scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/joehand/hyperdrive-duplicate.git"},"author":{"name":"Joe Hand","email":"joe@hand.email","url":"https://joeahand.com/"},"license":"MIT","bugs":{"url":"https://github.com/joehand/hyperdrive-duplicate/issues"},"homepage":"https://github.com/joehand/hyperdrive-duplicate#readme","dependencies":{"stream-equal":"^0.1.9"},"peerDependencies":{"hyperdrive":"^9.0.0"},"devDependencies":{"hyperdrive":"^9.0.0","random-access-memory":"^2.3.0","standard":"^9.0.2","tape":"^4.6.3"},"gitHead":"3758648b827d168c03801527483c800dd10fa01a","_id":"hyperdrive-duplicate@3.0.0","_npmVersion":"5.5.1","_nodeVersion":"8.3.0","_npmUser":{"name":"jhand","email":"joe@hand.email"},"dist":{"integrity":"sha512-NxsuBAivllLzRD23+RUfK/E9UQY/TTJGQBdUqBbwNuojEDXKEESAJQUJ5WCP2eA7VjbBMvChHtvMRkgM6sTA6w==","shasum":"bca21811ea9d6512acbc1944c6d6f7e89a99ccac","tarball":"https://registry.npmjs.org/hyperdrive-duplicate/-/hyperdrive-duplicate-3.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCfQTR27wpXeCrP124acFVTpxkEvK0DWCb0MxISw3uvswIhAJKlIik6v4a9XMtt8uQR3EWo5zwTqRJCU8cL3k0qJ1in"}]},"maintainers":[{"name":"jhand","email":"joe@hand.email"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hyperdrive-duplicate-3.0.0.tgz_1512071165320_0.16720508108846843"}}},"readme":"# hyperdrive-duplicate\n\n[![Travis](https://img.shields.io/travis/joehand/hyperdrive-duplicate.svg?style=flat-square)](https://travis-ci.org/joehand/hyperdrive-duplicate) [![npm](https://img.shields.io/npm/v/hyperdrive-duplicate.svg?style=flat-square)](https://npmjs.org/package/hyperdrive-duplicate)\n\nCheck if a file on the filesystem is the same as an entry in hyperdrive by comparing `stat` objects and file contents.\n\n* Compare `archive.stat` and `fs.stat` first, then\n* Compare `archive.createReadStream` and `fs.createReadStream` (will fail as soon as stream differs).\n\n**Warning! Can be decrease performance to check duplicates of many large files.**\n\n## Usage\n\n```js\nvar isDuplicate = require('hyperdrive-duplicate')\n\nvar archive = hyperdrive(ram)\n\narchive.writeFile('example.js', fs.readFileSync('example.js'), function (err) {\n  if (err) throw err\n  // example.js is now in the archive\n  // we can see if the fs file is duplicate\n  isDuplicate(archive, 'example.js', function (err, duplicate) {\n    if (err) throw err\n    if (duplicate) console.log('example.js is duplicate!')\n  })\n\n  isDuplicate(archive, 'index.js', 'example.js', function (err, duplicate) {\n    // index.js is a file on our fs\n    // example.js is the file in our archive\n    if (err) throw err\n    if (duplicate) console.log('index.js not a duplicate of example.js!')\n  })\n})\n```\n\n## API\n\n### isDuplicate(archive, filePath, [entryName], cb)\n\nCallback returns `(err, isDuplicate)` where `isDuplicate` is a boolean, true if the file is a duplicate.\n\nIf `filePath` is different from the entry name in hyperdrive, specify both.\n\n## License\n\nMIT\n","maintainers":[{"name":"jhand","email":"joe@hand.email"}],"time":{"modified":"2022-06-18T23:32:40.272Z","created":"2016-11-08T01:19:08.028Z","1.0.0":"2016-11-08T01:19:08.028Z","2.0.0":"2017-04-06T00:08:36.419Z","3.0.0":"2017-11-30T19:46:05.633Z"},"homepage":"https://github.com/joehand/hyperdrive-duplicate#readme","repository":{"type":"git","url":"git+https://github.com/joehand/hyperdrive-duplicate.git"},"author":{"name":"Joe Hand","email":"joe@hand.email","url":"https://joeahand.com/"},"bugs":{"url":"https://github.com/joehand/hyperdrive-duplicate/issues"},"license":"MIT","readmeFilename":"readme.md"}