Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
coolCucumber-cat opened this issue May 1, 2023 · 1 comment

Comments

@coolCucumber-cat
Copy link

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.

@jcubic
Copy link
Contributor

jcubic commented Jan 3, 2024

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants