1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | 1 1 1 3 8 8 8 | import {Writable} from 'stream'; import {RestrictTo, System} from '@btilford/ts-base-lint'; @RestrictTo({ system: { name: System.Node } }) export class StringWriter extends Writable { protected _output = ''; get output(): string | undefined { return this._output; } _write(chunk: any, encoding: string, callback: (error?: (Error | null)) => void): void { this._output += chunk; callback(); } } |