yeoman / update-notifier

Update notifications for your CLI app
BSD 2-Clause "Simplified" License
1.76k stars 132 forks source link

Allow to define an update message in a template with arguments #176

Closed jarrodek closed 4 years ago

jarrodek commented 4 years ago

I understand that I can pass the message argument to the notify() function. However I would like to specify a slightly different message but keep the original formatting. Right now I have to install chalk, import it, and construct own message. It would be nice to have to be able to specify message option as a template with variables that are processed internally without me having to import chalk and work with notifier.update variables.

An example:

notifier.notify({
    message: `Update available {current} → {latest}
Run {command} to update.

My custom message.`
});

It's not really a big deal to format the message by myself but that would save some time.