Buckets:
ktongue/docker_container / .cache /opencode /node_modules /thread-stream /test /to-file-on-destroy.js
| 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() | |
| }, | |
| destroy (err, cb) { | |
| // process._rawDebug('destroy called') | |
| fs.writeFile(opts.dest, data, function (err2) { | |
| cb(err2 || err) | |
| }) | |
| } | |
| }) | |
| } | |
| module.exports = run | |
Xet Storage Details
- Size:
- 433 Bytes
- Xet hash:
- 4ad091440378e941596d767d98dec92e1ea3cf9103e9c5e02b56acdd55c2a8fd
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.