But the output is not uppercased . Where did I do things wrong ?
Roelof
Aria Stewart
unread,
Jan 18, 2015, 10:17:39 AM1/18/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nod...@googlegroups.com
> On 18 Jan 2015, at 04:53, Roelof Wobben <rwo...@hotmail.com> wrote:
>
> Hello,
>
> I try to make a function which uppercase a stream by using through2.
>
> So I did this :
>
> ~~~
>
> var through = require('through2');
> var tr = through(function (chunk, enc,callback) {
> chunk. toString().toUpperCase();
> this.push(chunk);
try this.push(chunk.toString().toUpperCase());
String methods in javascript return new strings, rather than modifying the string.
> callback();
> });
>
> process.stdin.pipe(tr).pipe(process.stdout);
>
> ~~~
>
> But the output is not uppercased . Where did I do things wrong ?
>
> Roelof
>
>