dynamodb-read-stream
Version:
Readable stream client for DynamoDB
25 lines • 755 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.AbstractReader = void 0;
const stream_1 = require("stream");
class AbstractReader extends stream_1.Readable {
constructor(source) {
super({ objectMode: true });
this.source = source;
this.source.on('data', this.onData.bind(this));
this.source.on('end', this.onEnd.bind(this));
}
_read(size) {
this.source.readStart();
}
onData(chunk) {
this.push(chunk);
}
onEnd() {
this.push(null);
this.source.removeListener('data', this.onData);
this.source.removeListener('end', this.onEnd);
}
}
exports.AbstractReader = AbstractReader;
//# sourceMappingURL=AbstractReader.js.map