org-report-stats/utils.mjs

35 lines
720 B
JavaScript

import fs from "node-fs";
export const headersTsv = 'amount\t' +
'content\t' +
'description\t' +
'destination\t' +
'end\t' +
'kind of activity\t' +
'person\t' +
'place\t' +
'source\t' +
'start\t' +
'unique id\t' +
'url\t'
const outputAbsolutePath = '/home/tykayn/Nextcloud/ressources/social sorting/output/';
export async function writeFileInOuputFolderFromJsonObject(fileName, jsonObjectThing) {
// console.log('statistics.dates', statistics.dates)
return await fs.writeFile(
`${fileName}`,
JSON.stringify(jsonObjectThing),
"utf8",
(err) => {
if (err) {
console.log(`Error writing file: ${err}`);
} else {
console.log(`File ${fileName} is written successfully!`);
}
}
);
}