manojc/xtreamer

use transform

Closed this issue · 2 comments

Hi!

I used xtreamer with enabled transform. If I do console.log(xmlNode) in the transformer-test.js file and get
<Buffer 22 54 65 73 74 20 50 61 72 73 65 20 45 72 67 65 62 6e 69 73 22>

const xtreamerTransform = xtreamer(node, { transformer: transformer }) .on("data", (xmlNode) => { console.log(xmlNode);
What did I do wrong?

Hello @baeckerman83! Apologies for late reply.

As xtreamer is an extension of Transform Stream, the data event emits data in the form of Buffer.

If you check this transformer function, you will find that the function is converting the Buffer to String using toString() method (which is then supplied to a JSON converter).

I hope this solves the problem.

Closing the issue as no further queries received.