stream-equal
Advanced tools
Comparing version 1.1.1 to 2.0.0
@@ -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 | ||
[](http://travis-ci.org/fent/node-stream-equal) | ||
[](https://david-dm.org/fent/node-stream-equal) | ||
@@ -16,7 +15,5 @@ [](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 @@ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
11420
0
6
9
133
43
1