NodeJS Express Dynamic File Download

I want the user to be able to query the database and download a nicely formatted txt file with their results. What is the best way of doing this? Right now I write to a temp file, let the user download it, and then delete the accumulated files once a week. Is there a NodeJS way of doing this?