dieumercimvemba's picture
download
raw
727 Bytes
'use strict'
const t = require('tap')
if (process.env.CI) {
t.skip('skip on CI')
process.exit(0)
}
const { join } = require('path')
const { file } = require('./helper')
const { stat } = require('fs')
const ThreadStream = require('..')
t.setTimeout(30000)
const dest = file()
const stream = new ThreadStream({
filename: join(__dirname, 'to-file.js'),
workerData: { dest },
sync: false
})
let length = 0
stream.on('close', () => {
stat(dest, (err, f) => {
t.error(err)
t.equal(f.size, length)
t.end()
})
})
const buf = Buffer.alloc(1024).fill('x').toString() // 1 KB
// This writes 1 GB of data
for (let i = 0; i < 1024 * 1024; i++) {
length += buf.length
stream.write(buf)
}
stream.end()

Xet Storage Details

Size:
727 Bytes
·
Xet hash:
a28e838bb7acd90768cda81bd2b9ba069a3ea74614a3ff3bdd5f45c433c7607f

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