Export CSV without writing to disk?

I’m using NodeJS and I have a Server Action with a database query. Is it possible to export a CSV without writing to disk?

I really just want to get data from the database and output it directly in CSV format

Think its going to have to be:

  1. write to disk
  2. load file
  3. delete from disk