metaforecast/src/backend/manual/manualDownload.ts

15 lines
362 B
TypeScript
Raw Normal View History

import "dotenv/config";
import fs from "fs";
2022-04-07 00:53:08 +00:00
import { pgRead } from "../database/pg-wrapper";
2022-03-16 21:02:34 +00:00
let main = async () => {
2022-04-07 00:53:08 +00:00
let json = await pgRead({ tableName: "questions" });
2022-03-16 21:02:34 +00:00
let string = JSON.stringify(json, null, 2);
let filename = "metaforecasts.json";
fs.writeFileSync(filename, string);
console.log(`File downloaded to ./${filename}`);
};
main();