How to use the cli-color.red function in cli-color

To help you get started, we’ve selected a few cli-color examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gameclosure / devkit / src / deploy / index.js View on Github external
res.on('end', function () {
				var stitch = chunks.join("");
				var response;
				try {
					response = JSON.parse(stitch);
				} catch (e) {
					console.log(clc.red("ERROR"), e)
					console.log(stitch);
					return;
				}

				if (response.error) {
					console.log(clc.red("ERROR"), response); 
				} else if (response.status === "OK") {
					console.log(clc.green("SUCCESS") +" Deploy successful");
				}
			});
		});
github ericnishio / instagram-save / bin / cli.js View on Github external
}, err => {
    console.log(clc.red(`Failed to download file from ${err.url}`));
  });
}
github Workshape / reql-cli / src / repl.es6 View on Github external
.catch(e => {
      console.log(clc.red(e))
      that.help()
    })
    .finally(function() {
github atduarte / sms-cli / index.js View on Github external
request.get('messages', function (err, httpResponse, body) {
    if (err || httpResponse.statusCode != 200) {
        console.error('Couldn\'t connect to the API to get the messages');
        return;
    }

    var messages = selectMessages(JSON.parse(body).result || {}, config.messageCount);

    if (messages.length == 0) {
        console.error(clc.red('No messages to show'));
        return;
    }

    printMessages(messages);
    promptSend(messages);
});
github felipenmoura / sos-stackoverflow-search / dist / highlighter.js View on Github external
attrs.forEach(function (attr) {
                            tagStr = tagStr.replace(attr, cliColor.red(attr));
                        });
                    }
github uber-node / ringpop-node / scripts / tick-cluster.js View on Github external
function suspendProc(count) {
    toSuspend = +count;

    var suspended = [];
    while (suspended.length < toSuspend) {
        var rand = Math.floor(Math.random() * procs.length);
        var proc = procs[rand];
        if (proc.killed === null && proc.suspended === null) {
            logMsg(proc.port, color.green('pid ' + proc.pid) + color.red(' randomly selected for sleep'));
            process.kill(proc.proc.pid, 'SIGSTOP');
            proc.suspended = Date.now();
            suspended.push(proc);
        }
    }
}
github itsezc / CycloneIO / packages / utils / clothing / source / extractor.ts View on Github external
private async extractSWF(swf: { name: string, rawData: Buffer }): Promise<{ name: string, images: Image[], symbols: string[] }> {
        const { name, rawData } = swf

        Logger.info(`${blueBright('[EXTRACTING]')}${cyan('[SWF]')} ${name}`)

        let { tags } = await readFromBufferP(rawData)

        Logger.info(`${blueBright('[EXTRACTING]')}${red('[IMAGES]')} ${name}`)

        const images = await Promise.all(extractImages(tags))

        tags = tags.filter(tag => {
            return tag.code === 76
        })

        Logger.info(`${blueBright('[EXTRACTING]')}${yellow('[SYMBOLS]')} ${name}`)

        const symbols = this.extractSymbols(tags)

        Logger.info(`${blueBright('[EXTRACTING]')}${green('[DONE]')} ${name}`)

        return { name, images, symbols }
    }
github felipenmoura / sos-stackoverflow-search / src / stringUtils.js View on Github external
let cardinal = require('cardinal');
let cliColor = require('cli-color');

const INDENT = "    ";
const CODE_START = cliColor.red(`+--------------------`);
const CODE_LINE = cliColor.red(`\n${INDENT}| `);
const CODE_END = cliColor.red(`\n${INDENT}+--------------------\n`);
const LINE_SIZE = process.stdout.columns > 80? 80: process.stdout.columns;
const ALLOWED_TAGS = [
    'pre',
    'code',
    'a',
    'i',
    '\/p',
    'strong',
    'blockquote',
    'li',
    'hr\/'
];
let allowedTags = ALLOWED_TAGS.join('|') + '|\/' + ALLOWED_TAGS.join('|\/');

module.exports = function (str) {