Files
ig-data-count/utility/writeToMarkdown.js

11 lines
366 B
JavaScript
Raw Normal View History

2020-03-19 08:07:47 +05:30
//@ts-check
/**
* @param {Array<{parts: number;count: number;person: String;}>} data
*/
2020-03-19 12:01:43 +05:30
module.exports = (data,location) => {
2020-03-19 08:07:47 +05:30
let writable = "Name | Count | Parts\n --- | --- | ---\n"
data.forEach(element => {
2020-03-19 08:18:50 +05:30
writable += `\`${element.person}\` | ${element.count} | ${element.parts}\n`
2020-03-19 08:07:47 +05:30
});
2020-03-19 12:01:43 +05:30
require('fs').writeFileSync(location, writable)
2020-03-19 08:07:47 +05:30
}