UNPKG

better-logging

Version:

better-logging is a drop in replacement for the default logging methods of node.js

7 lines (6 loc) 379 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.removeColors = void 0; // Stolen from Stackoverflow... I have not gone through the regex to verify it, but it seems to be working. const removeColors = (msg) => msg.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, ''); exports.removeColors = removeColors;