Files
infocom-systems-design/node_modules/thread-stream/test/port.js
2025-10-03 22:27:28 +03:00

17 lines
263 B
JavaScript

'use strict'
const { Writable } = require('stream')
function run (opts) {
const { port } = opts
return new Writable({
autoDestroy: true,
write (chunk, enc, cb) {
port.postMessage(chunk.toString())
cb()
}
})
}
module.exports = run