serverless-spy
Version:
CDK-based library for writing elegant integration tests on AWS serverless architecture and an additional web console to monitor events in real time.
16 lines (13 loc) • 379 B
JavaScript
const c = require('colorette');
exports.colorize = (text) => {
return text.replace(/<([^>]+)>/gi, (match) => {
return c.blue(match);
}).replace(/<command>/gi, (match) => {
return c.magenta(match);
}).replace(/\[([^[\]]+)\]/gi, (match) => {
return c.yellow(match);
}).replace(/ --?([^\s,]+)/gi, (match) => {
return c.green(match);
});
};
;