Socket
Socket
Sign inDemoInstall

thread-stream

Package Overview
Dependencies
1
Maintainers
4
Versions
42
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.13.0 to 0.13.1

test/dir with spaces/test-package.zip

2

lib/worker.js

@@ -33,3 +33,3 @@ 'use strict'

workerData.filename.startsWith('file://')) {
fn = realRequire(workerData.filename.replace('file://', ''))
fn = realRequire(decodeURIComponent(workerData.filename.replace('file://', '')))
} else {

@@ -36,0 +36,0 @@ throw error

{
"name": "thread-stream",
"version": "0.13.0",
"version": "0.13.1",
"description": "A streaming way to send data to a Node.js Worker Thread",

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

'use strict'
const { test } = require('tap')
const { join } = require('path')
const { MessageChannel } = require('worker_threads')
const { once } = require('events')
const ThreadStream = require('..')

@@ -30,1 +33,25 @@

})
test('yarn module resolution for directories with special characters', { skip: !isYarnPnp }, async t => {
t.plan(3)
const { port1, port2 } = new MessageChannel()
const stream = new ThreadStream({
filename: join(__dirname, 'dir with spaces', 'test-package.zip', 'worker.js'),
workerData: { port: port1 },
workerOpts: {
transferList: [port1]
},
sync: false
})
t.teardown(() => {
stream.end()
})
t.ok(stream.write('hello world\n'))
t.ok(stream.write('something else\n'))
const [strings] = await once(port2, 'message')
t.equal(strings, 'hello world\nsomething else\n')
})

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc