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

Support writing to other destinations #80

Open
darichey opened this issue Oct 7, 2021 · 0 comments
Open

Support writing to other destinations #80

darichey opened this issue Oct 7, 2021 · 0 comments

Comments

@darichey
Copy link

darichey commented Oct 7, 2021

It would be great if we could write to stdout or a Buffer, for example. This should be very easy, because fs.writeFile already supports writing to these.

This already works:

const writer: CsvWriter<T> = createObjectCsvWriter({
    // @ts-ignore
    path: process.stdout.fd,
   // ...
});

Therefore, the only thing that needs to change is the type of path to match the type of the file parameter for fs.writeFile. However, this has changed over time. The readme states the minimum version of node is 4 (in which string is the correct type), but the version of node types is "^14.14.7".

What do you think? If you are amenable to the idea, I can open a pull request.

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