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 2.0.0 to 2.0.1

3

lib/worker.js

@@ -47,2 +47,5 @@ 'use strict'

fn = realRequire(decodeURIComponent(filename.replace('file://', '')))
} else if (error.code === undefined) {
// When bundled with pkg, an undefined error is thrown when called with realImport
fn = realRequire(decodeURIComponent(filename.replace(process.platform === 'win32' ? 'file:///' : 'file://', '')))
} else {

@@ -49,0 +52,0 @@ throw error

4

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

@@ -8,3 +8,3 @@ "main": "index.js",

"dependencies": {
"real-require": "^0.1.0"
"real-require": "^0.2.0"
},

@@ -11,0 +11,0 @@ "devDependencies": {

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

test('bundlers support', function (t) {
test('bundlers support with .js file', function (t) {
t.plan(1)

@@ -35,1 +35,28 @@

})
test('bundlers support with .mjs file', function (t) {
t.plan(1)
globalThis.__bundlerPathsOverrides = {
'thread-stream-worker': join(__dirname, 'custom-worker.js')
}
const dest = file()
process.on('uncaughtException', error => {
console.log(error)
})
const stream = new ThreadStream({
filename: join(__dirname, 'to-file.mjs'),
workerData: { dest },
sync: true
})
stream.worker.removeAllListeners('message')
stream.worker.once('message', message => {
t.equal(message.code, 'CUSTOM-WORKER-CALLED')
})
stream.end()
})
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