metaforecast/src/backend/utils/misc/process-forecasts-template.ts
Vyacheslav Matyukhin 164f996f41
feat: convert all js to ts
allowJs is set to false in tsconfig.json now; please write all future
code with typescript.

cleanups:
- removed platforms/deprecated
- removed flow/history/old
    - see https://github.com/QURIresearch/metaforecast/issues/22
- commented some invalid axios options
- minor fixes with mismatching function arguments
- commented invalid mongo call in databaseReadWithReadCredentials
- {encoding: 'utf-8'} in readFileSync calls
2022-03-28 00:32:47 +03:00

20 lines
379 B
TypeScript

/* Imports */
import fs from 'fs';
/* Definitions */
let locationData = "./data/";
/* Body */
let rawdata = fs.readFileSync("../data/merged-questions.json", {
encoding: "utf-8",
});
let data = JSON.parse(rawdata);
let results = [];
for (let datum of data) {
// do something
}
let string = JSON.stringify(results, null, 2);
fs.writeFileSync("../data/output.txt", string);