@signalk/streams
Version:
Utilities for handling streams of Signal K data
19 lines (18 loc) • 495 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const stream_1 = require("stream");
class TcpServer extends stream_1.Transform {
options;
constructor(options) {
super();
this.options = options;
}
pipe(pipeTo) {
this.options.app.on('tcpserver0183data', (d) => this.write(d));
return super.pipe(pipeTo);
}
_transform(data, encoding, callback) {
callback(null, data);
}
}
exports.default = TcpServer;