mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-10-22 19:27:40 +00:00
Coloured warnings and errors under Node.js
This commit is contained in:
@@ -12,6 +12,13 @@ Various static utility functions.
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
Display a warning, in colour if we're on a terminal
|
||||
*/
|
||||
exports.warning = function(text) {
|
||||
console.log($tw.node ? "\x1b[1;33m" + text + "\x1b[0m" : text);
|
||||
}
|
||||
|
||||
/*
|
||||
Trim whitespace from the start and end of a string
|
||||
Thanks to Steven Levithan, http://blog.stevenlevithan.com/archives/faster-trim-javascript
|
||||
|
Reference in New Issue
Block a user