Socket
Socket
Sign inDemoInstall

thread-stream

Package Overview
Dependencies
Maintainers
4
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

thread-stream - npm Package Compare versions

Comparing version 0.11.1 to 0.11.2

.taprc

16

index.js

@@ -12,3 +12,7 @@ 'use strict'

} = require('./lib/indexes')
const buffer = require('buffer')
// V8 limit for string size
const MAX_STRING = buffer.constants.MAX_STRING_LENGTH
class FakeWeakRef {

@@ -32,2 +36,5 @@ constructor (value) {

const registry = new FinalizationRegistry((worker) => {
if (worker.exited) {
return
}
worker.terminate()

@@ -127,2 +134,3 @@ })

if (stream === undefined) {
this.exited = true
// Terminate the worker.

@@ -154,2 +162,3 @@ this.terminate()

stream.closed = true
stream.worker.exited = true
// TODO only remove our own

@@ -175,2 +184,3 @@ stream.worker.removeAllListeners('exit')

stream.closed = true
stream.worker.exited = true
setImmediate(function () {

@@ -227,2 +237,8 @@ if (code !== 0) {

if (this.flushing && this.buf.length + data.length >= MAX_STRING) {
// process._rawDebug('write: flushing')
this._writeSync()
this.flushing = true // we are still flushing
}
if (!this.ready || this.flushing) {

@@ -229,0 +245,0 @@ this.buf += data

7

package.json
{
"name": "thread-stream",
"version": "0.11.1",
"version": "0.11.2",
"description": "A streaming way to send data to a Node.js Worker Thread",

@@ -12,6 +12,7 @@ "main": "index.js",

"standard": "^16.0.3",
"tap": "^15.0.0"
"tap": "^15.0.0",
"why-is-node-running": "^2.2.0"
},
"scripts": {
"test": "standard && tap --no-check-coverage test/*.test.*js",
"test": "standard && tap test/*.test.*js",
"test:ci": "standard && tap \"test/**/*.test.*js\" --no-check-coverage --coverage-report=lcovonly",

@@ -18,0 +19,0 @@ "test:yarn": "tap \"test/**/*.test.js\" --no-check-coverage",

@@ -6,2 +6,4 @@ 'use strict'

const { unlinkSync } = require('fs')
const why = require('why-is-node-running')
const t = require('tap')

@@ -12,3 +14,3 @@ const files = []

function file () {
const file = join(tmpdir(), `thread-stream-${process.pid}-${process.hrtime().toString()}-${count++}`)
const file = join(tmpdir(), `thread-stream-${process.pid}-${count++}`)
files.push(file)

@@ -19,4 +21,6 @@ return file

process.on('beforeExit', () => {
t.comment('unlink files')
for (const file of files) {
try {
t.comment(`unliking ${file}`)
unlinkSync(file)

@@ -27,4 +31,7 @@ } catch (e) {

}
t.comment('unlink completed')
})
module.exports.file = file
setInterval(why, 10000).unref()

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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