more content - now a cli tool

This commit is contained in:
2020-03-19 12:01:43 +05:30
parent ef2e180c88
commit 622229a608
4 changed files with 244 additions and 45 deletions

View File

@@ -2,10 +2,10 @@
/**
* @param {Array<{parts: number;count: number;person: String;}>} data
*/
module.exports = (data) => {
module.exports = (data,location) => {
let writable = "Name | Count | Parts\n --- | --- | ---\n"
data.forEach(element => {
writable += `\`${element.person}\` | ${element.count} | ${element.parts}\n`
});
require('fs').writeFileSync("output.md", writable)
require('fs').writeFileSync(location, writable)
}