patorjk / figlet.js

A FIG Driver written in JavaScript which aims to fully implement the FIGfont spec.
MIT License
2.61k stars 167 forks source link

async text #120

Closed Lev-Shapiro closed 11 months ago

Lev-Shapiro commented 11 months ago

Both figlet and figlet.text now support promises and async/await syntax instead of old callbacks ( that no one almost uses today )

Example of how to use it:

import figlet from figlet

(async()=>{
      const a = await figlet.text("Hello World", "Standard")
      console.log(a)
})()
Lev-Shapiro commented 11 months ago

@patorjk would that be a good idea to totally remove callback as a parameter?

patorjk commented 11 months ago

It should stay for backward compatibility, but I like the idea of moving to promises as the main way it should be used.

Lev-Shapiro commented 11 months ago

Sure, then I'll add some tests, examples and anything else that I'll find needed for this feature and very soon open the pull request

Lev-Shapiro commented 11 months ago

@patorjk I guess I've finished, is there anything else you would like for me to add?

patorjk commented 11 months ago

I've been pretty busy the past few days. I'll try and take a look at it soon and let you know.

patorjk commented 11 months ago

Looks good to me, I'll publish a new version of the package later this week. Thank you for working on this!

@all-contributors please add @Lev-Shapiro for code,example

allcontributors[bot] commented 11 months ago

@patorjk

I couldn't determine any contributions to add, did you specify any contributions? Please make sure to use valid contribution names.

I've put up a pull request to add @Lev-Shapiro! :tada: