figlet.js icon indicating copy to clipboard operation
figlet.js copied to clipboard

Question: Why doesn't figlet return the new text and why is error the first parameter of the callback?

Open coolCucumber-cat opened this issue 2 years ago • 1 comments

It's not a big deal but you would expect that that it would return the new text, especially if you want to save it in a variable. And for 90% of people, that first parameter of the callback is going to stay greyed out. No one is going to have custom error handling in case the text can't look nice. Just throw an error and have an optional parameter to not throw an error and return the inputted text. Again, it's not a big deal, but imagine if everyone did it like this.

coolCucumber-cat avatar May 01 '23 16:05 coolCucumber-cat

  1. You can use figlet.textSync to return a string,

  2. error as the first callback argument is a convention from NodeJS.

jcubic avatar Jan 03 '24 21:01 jcubic