Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
25 lines
423 B
Plaintext
25 lines
423 B
Plaintext
'use strict'
|
|
|
|
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
|