org-report-stats/utils.mjs

34 lines
721 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'
export async function writeFileInOuputFolderFromJsonObject(fileName, jsonObjectThing) {
return await fs.writeFile(
`${outputAbsolutePath}${fileName}`,
JSON.stringify(jsonObjectThing),
"utf8",
(err) => {
if (err) {
console.log(`Error writing file: ${err}`);
} else {
console.log(`File ${fileName} is written successfully!`);
}
}
);
}