This module helps you to manage your colorful alerts in Terminal. And they also care about the alerts are shown on any of the platforms like Windows, Linux, or Mac also.
It throws the message without blocking any other process so you can use it anywhere.
npm install alerts-in-cli
# or
yarn add alerts-in-cli
- success
- info
- warning
- error
- custom
name
const alerts = require('alerts-in-cli');
alerts({
type: 'success',
msg: 'Success alert'
});
const alerts = require('alerts-in-cli');
alerts({
type: 'info',
msg: 'Info alert'
});
const alerts = require('alerts-in-cli');
alerts({
type: 'warning',
msg: 'Warning alert'
});
const alerts = require('alerts-in-cli');
alerts({
type: 'error',
msg: 'Error alert'
});
In the name parameter, you can enter the text of your choice, which will appear in the colored bullet, you can use it with any type. It is not mandatory to use name
they are optional for use.
const alerts = require('alerts-in-cli');
alerts({
type: 'success',
msg: 'File saved!',
name: 'Done'
});