Socket
Socket
Sign inDemoInstall

final-stream

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

final-stream - npm Package Compare versions

Comparing version 2.0.2 to 2.0.3

1

index.js

@@ -25,3 +25,2 @@ const { promisify } = require('util');

})
.on('destroy', finish)
.on('end', finish)

@@ -28,0 +27,0 @@ .on('close', finish)

2

package.json
{
"name": "final-stream",
"version": "2.0.2",
"version": "2.0.3",
"description": "A tool to read a full stream and callback once finished with the data",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -80,1 +80,25 @@ const test = require('tape');

});
test('when stream is destroyed prematurely', async t => {
t.plan(1);
const testFilePath = './test/testFiletoStream.txt';
const testFileContent = fs.readFileSync(testFilePath, 'utf8');
const stream = fs.createReadStream(testFilePath, { highWaterMark: 32 });
stream.destroy();
const result = await finalStream(stream);
t.equal(result.toString(), '');
});
test('when stream is closed prematurely', async t => {
t.plan(1);
const testFilePath = './test/testFiletoStream.txt';
const testFileContent = fs.readFileSync(testFilePath, 'utf8');
const stream = fs.createReadStream(testFilePath, { highWaterMark: 32 });
stream.close();
const result = await finalStream(stream);
t.equal(result.toString(), '');
});
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