Buckets:
| /** | |
| * This file is packaged using pkg in order to test if worker.js works in that context. | |
| * Note: We can't use node:test here because it crashes inside pkg bundles due to V8 internals. | |
| */ | |
| const assert = require('node:assert') | |
| const { join } = require('path') | |
| const { file } = require('../helper') | |
| const ThreadStream = require('../..') | |
| globalThis.__bundlerPathsOverrides = { | |
| 'thread-stream-worker': join(__dirname, '..', 'custom-worker.js') | |
| } | |
| const dest = file() | |
| process.on('uncaughtException', (error) => { | |
| console.error(error) | |
| process.exit(1) | |
| }) | |
| const stream = new ThreadStream({ | |
| filename: join(__dirname, '..', 'to-file.js'), | |
| workerData: { dest }, | |
| sync: true | |
| }) | |
| stream.worker.removeAllListeners('message') | |
| stream.worker.once('message', (message) => { | |
| assert.strictEqual(message.code, 'CUSTOM-WORKER-CALLED') | |
| console.log('pkg test passed') | |
| process.exit(0) | |
| }) | |
| stream.end() | |
Xet Storage Details
- Size:
- 916 Bytes
- Xet hash:
- 8cd913f47c9e8b83c4d82be036417016c3729a22bd81b1957ffebb6890da4199
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.