forked from handsontable/handsontable
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconsole.mjs
More file actions
45 lines (40 loc) · 1.11 KB
/
console.mjs
File metadata and controls
45 lines (40 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import chalk from 'chalk';
/**
* Display an error message in the console.
*
* @param {string} message The message to be displayed.
*/
export function displayErrorMessage(message) {
console.log(chalk.red(`ERROR: ${message}`));
}
/**
* Display a warning message in the console.
*
* @param {string} message The message to be displayed.
*/
export function displayWarningMessage(message) {
console.log(chalk.yellow(`WARNING: ${message}`));
}
/**
* Display a confirmation message in the console.
*
* @param {string} message The message to be displayed.
*/
export function displayConfirmationMessage(message) {
console.log(chalk.green(`${message}`));
}
/**
* Display a default info message in the console.
*
* @param {string} message The message to be displayed.
*/
export function displayInfoMessage(message) {
console.log(chalk.white(`${message}`));
}
/**
* Display a separator surrounded by empty lines. (useful to temporarily visually distance the output from the
* `experimental` warnings).
*/
export function displaySeparator() {
console.log('\n-----------------------------------------------------\n');
}