New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

stream-equal

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stream-equal - npm Package Compare versions

Comparing version 1.1.1 to 2.0.0

dist/index.d.ts

37

package.json

@@ -12,3 +12,3 @@ {

],
"version": "1.1.1",
"version": "2.0.0",
"repository": {

@@ -18,27 +18,28 @@ "type": "git",

},
"author": "fent (https://github.com/fent)",
"main": "./lib/index.js",
"author": "fent <fentbox@gmail.com> (https://github.com/fent)",
"main": "./dist/index.js",
"files": [
"lib"
"dist"
],
"typings": "./lib/index.d.ts",
"scripts": {
"test": "istanbul cover node_modules/.bin/_mocha -- test/*-test.js"
"build": "tsc -p tsconfig.build.json",
"test": "nyc --extension .ts --reporter=lcov --reporter=text-summary npm run test:unit",
"test:unit": "mocha -- --require ts-node/register test/*-test.ts"
},
"directories": {
"lib": "./lib"
},
"optionalDependencies": {
"@types/node": "*"
},
"devDependencies": {
"istanbul": "^0.4.5",
"mocha": "^5.0.0",
"nock": "^9.0.22",
"request": "^2.85.0"
"@types/mocha": "^7.0.2",
"@types/node": "^14.0.6",
"@types/request": "^2.48.5",
"mocha": "^7.2.0",
"nock": "^12.0.3",
"nyc": "^15.0.1",
"request": "^2.88.0",
"ts-node": "^8.10.2",
"typescript": "^3.9.3"
},
"engines": {
"node": ">=4"
"node": ">=10"
},
"license": "MIT"
"license": "MIT",
"dependencies": {}
}

@@ -5,3 +5,2 @@ # node-stream-equal

[![Build Status](https://secure.travis-ci.org/fent/node-stream-equal.svg)](http://travis-ci.org/fent/node-stream-equal)
[![Dependency Status](https://david-dm.org/fent/node-stream-equal.svg)](https://david-dm.org/fent/node-stream-equal)

@@ -16,7 +15,5 @@ [![codecov](https://codecov.io/gh/fent/node-stream-equal/branch/master/graph/badge.svg)](https://codecov.io/gh/fent/node-stream-equal)

var readStream1 = fs.createReadStream(file);
var readStream2 = fs.createReadStream(file);
streamEqual(readStream1, readStream2, (err, equal) => {
console.log(equal); // true
});
let readStream1 = fs.createReadStream(file);
let readStream2 = fs.createReadStream(file);
let equal = await streamEqual(readStream1, readStream2);
```

@@ -26,3 +23,3 @@

# Motive
Useful for testing. This method is faster and uses much less memory than buffering entire streams and comparing their content, specially for bigger files.
Useful for testing. This method of comparing is faster and uses less memory than buffering entire streams and comparing their content, specially for bigger files.

@@ -33,5 +30,5 @@ You could also get the hash sum of a stream to test it against another stream. But that would take up more CPU due to the hashing and would require a bit more data to be read if they are not equal.

# API
### streamEqual(readStream1, readStream2, [callback(err, equal)])
### async streamEqual(readStream1, readStream2)
Will compare each `data` event on both streams, pausing when needed to keep them in sync. `equal` will be either `true` or `false` if there is no `err`. Returns a promise if callback is not given.
A function that compares each `data` event on both streams, pausing when needed to keep them in sync. Returns a proimse that resolves to either `true` or `false`.

@@ -38,0 +35,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc