download
raw
692 Bytes
'use strict'
const { join } = require('path')
const ThreadStream = require('..')
const assert = require('assert')
let worker = null
function setup () {
const stream = new ThreadStream({
filename: join(__dirname, 'to-file.js'),
workerData: { dest: process.argv[2] },
sync: true
})
worker = stream.worker
stream.write('hello')
stream.write(' ')
stream.write('world\n')
stream.flushSync()
stream.unref()
// the stream object goes out of scope here
setImmediate(gc) // eslint-disable-line
}
setup()
let exitEmitted = false
worker.on('exit', function () {
exitEmitted = true
})
process.on('exit', function () {
assert.strictEqual(exitEmitted, true)
})

Xet Storage Details

Size:
692 Bytes
·
Xet hash:
4f1bcd55af8c88927508b1bc2210c3330f3093bc6c674e950d9e006aa3421cb4

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.