my-own-words
Version:
A small tool that I have created to keep safe all those words/expressions that I come across when I'm learning a new language
19 lines (13 loc) • 423 B
JavaScript
const {
listExists, createFile, getAndParseWords, saveIntoMarkdown,
} = require('./fs-helpers');
function print(listName) {
if (!listExists(listName)) return `${listName} list doesn't exists!`;
const words = getAndParseWords(listName);
createFile(listName, 'md');
Object.keys(words).map(word =>
saveIntoMarkdown(listName, `**${word}**: ${words[word].join(', ')}. \n`));
}
module.exports = {
print,
};