Projektstart
This commit is contained in:
16
backend/node_modules/thread-stream/test/port.js
generated
vendored
Normal file
16
backend/node_modules/thread-stream/test/port.js
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
'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
|
||||
Reference in New Issue
Block a user