INNER CODE UNIT · JavaScript
Generator
adaltas/node-csv · packages/csv-generate/lib/index.js:12
const Generator = function (options = {}) {
this.options = normalize_options(options);
// Call parent constructor
stream.Readable.call(this, this.options);
this.state = init_state(this.options);
return this;
};
util.inherits(Generator, stream.Readable);
// Stop the generation.
Generator.prototype.end = function () {
this.push(null);
};
// Put new data into the read queue.
Generator.prototype._read = function (size) {
setImmediate(() => {
this.__read(size);
});