Skip to content

Instantly share code, notes, and snippets.

@wbarcovsky
Last active May 11, 2023 09:47
Show Gist options
  • Select an option

  • Save wbarcovsky/19b198e280dae8a11cbd40b345a5081b to your computer and use it in GitHub Desktop.

Select an option

Save wbarcovsky/19b198e280dae8a11cbd40b345a5081b to your computer and use it in GitHub Desktop.
const fs = require('fs');
const path = require('path');
const data = await db.query(`SELECT * FROM table`);
let result = '';
for (let row of data) {
result += await processData(row);
}
fs.writeFileSync(path.join(__dirname, 'tmp.csv'), result);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment