thread-stream
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -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 |
{ | ||
"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() | ||
}) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
59761
1709
+ Addedreal-require@0.2.0(transitive)
- Removedreal-require@0.1.0(transitive)
Updatedreal-require@^0.2.0