Buckets:
| const fs = require('fs') | |
| const { Writable } = require('stream') | |
| function run (opts) { | |
| let data = '' | |
| return new Writable({ | |
| autoDestroy: true, | |
| write (chunk, enc, cb) { | |
| data += chunk.toString() | |
| cb() | |
| }, | |
| final (cb) { | |
| setTimeout(function () { | |
| fs.writeFile(opts.dest, data, function (err) { | |
| cb(err) | |
| }) | |
| }, 100) | |
| } | |
| }) | |
| } | |
| module.exports = run | |
Xet Storage Details
- Size:
- 423 Bytes
- Xet hash:
- 005df22af3efffd3fa2bbdca1f80d846064c8a13074d59e719036f2666b6d7f1
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.