Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] end() usage on writing data to csv file #776

Open
300LiterPropofol opened this issue Feb 25, 2022 · 0 comments
Open

[Question] end() usage on writing data to csv file #776

300LiterPropofol opened this issue Feb 25, 2022 · 0 comments

Comments

@300LiterPropofol
Copy link

300LiterPropofol commented Feb 25, 2022

Hello!

Thank you for creating this awesome package. I have a question on the usage of end() though.

I am confused about how the syntax end() functions in the csv file writing. I have some similar code as below:

const fs = require('fs'); // build-in module
const fastcsv = require('fast-csv');

const fileName = `File_${String(Math.round(new Date().getTime()))}.csv`;
const csvFile = fs.createWriteStream(fileName);
fastcsv.write(dataArray, { headers: true }).pipe(csvFile);

I didn't use any end() syntax since I don't know where to put it. And the syntax above can output a file for me.
I wonder without this end() syntax, is it possible that not all data in dataArray is written down inside the csv? For example, if I am sending this fileName to another function and uploads this file using the name. Is it possible that what I upload is not the full dataArray?

Could you explain more about the usage of end() ? thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant