Shows a banner on the CLI using a cool font.
For NodeJs & TypeScript. Depends on the amazing figlet
and chalk
libraries.
import figlet from 'figlet'
import chalk from 'chalk'
/**
* Clears the console and shows the banner
*/
async function showBanner (): Promise<void> {
return new Promise(function (resolve, reject) {
process.stdout.write('\x1b[2J')
process.stdout.write('\x1b[0f')
figlet.text('the banner', function (error, result) {
if (error) reject(error)
else {
console.log(chalk.blue(result))
resolve()
}
})
})
}