// WRITERS (Duplex to support reading if chained) // write notes to REPL get toRepl() { return track( new Duplex({ objectMode: true, // drops hwm to 16 read() {}, write(chunk, encoding, callback) { const note = chunk.input.replace(/^(.)\#/,'$1s') // use typeString over stdout as the latter won't allow the user // to delete as though they entered the text themselves robot.typeString(`${note}, `) callback(null, chunk) this.push(chunk) } }) ) }