-
Notifications
You must be signed in to change notification settings - Fork 216
Open
Description
Hi,
I'm new to the project and the Stream API. After spending too much time getting the first block below working, I was asking myself why it isn't equivalent to the second one. Could you kindly explain me what I'm doing wrong there?
Thanks!
Working:
const enhance = (filename) => {
const inPath = path.join(__dirname, filename);
const outStream = fs.createWriteStream(inPath.replace(".csv", ".transformed.csv"));
parseFile(inPath, { headers: true })
.transform(myTransformerFunction)
.pipe(format({ headers: true }))
.pipe(outStream);
};Not working:
const enhance = (filename) => {
const inPath = path.join(__dirname, filename);
parseFile(inPath, { headers: true })
.transform(myTransformerFunction)
.pipe(writeToPath(inPath.replace(".csv", ".transformed.csv")));
};Metadata
Metadata
Assignees
Labels
No labels