How to use the colors/safe.magenta function in colors

To help you get started, we’ve selected a few colors 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 aws / aws-cdk / packages / @aws-cdk / cloudformation-diff / lib / format.ts View on Github external
function _diffStrings(oldStr: string, newStr: string, context: number): string[] {
  const patch: Patch = structuredPatch(null, null, oldStr, newStr, null, null, { context });
  const result = new Array();
  for (const hunk of patch.hunks) {
    result.push(colors.magenta(`@@ -${hunk.oldStart},${hunk.oldLines} +${hunk.newStart},${hunk.newLines} @@`));
    const baseIndent = _findIndent(hunk.lines);
    for (const line of hunk.lines) {
      // Don't care about termination newline.
      if (line === '\\ No newline at end of file') { continue; }
      const marker = line.charAt(0);
      const text = line.slice(1 + baseIndent);
      switch (marker) {
      case ' ':
        result.push(`${CONTEXT} ${text}`);
        break;
      case '+':
        result.push(colors.bold(`${ADDITION} ${colors.green(text)}`));
        break;
      case '-':
        result.push(colors.bold(`${REMOVAL} ${colors.red(text)}`));
        break;
github sumanjs / suman / lib / watching / add-watcher.js View on Github external
this.on('stop-tty-received', function () {
                console.log('\n => SIGINT received =>  we will stop streaming watch results to the terminal,\n' +
                  'but they will continue to be streamed to the project-watch log file, here => \n ' +
                  colors.magenta(projectOutputLog), '\n\n');
                process.nextTick(function () {
                  process.exit(0);
                });
              });
github yoksel / wave-maker / gulpfile.js View on Github external
gulp.task('copy', function() {
  console.log(colors.magenta('⬤  Copy files to build/... ⬤'));

  return gulp.src(['assets/**/*', '*.html'])
    .pipe(copy('build/'));
});
github sumanjs / suman / lib / interactive / helpers / watch-helper.js View on Github external
}
    }

  ];

  try {
    require.resolve('suman-server');
  }
  catch (err) {

    const p = {
      type: 'confirm',
      name: 'confirmNoSumanServerInstalled',
      message: 'Please acknowledge that you will need to' +
      ' install the suman-server package if you wish to use the watch features,\n' +
      ' you can do that with ' + colors.magenta('"$ suman --use-server"') + ',  (we will auto-generate this command for you later, this is just FYI).',
      when: function () {
        console.log('\n\n -------------------------------------- \n\n');
        _suman.backspacing = false;
        return true;
      },
      onLeftKey: function () {
        _suman.onBackspace(backspaceCB);
      },
      validate: function (item) {
        return true;
      }
    };
    prompt1.unshift(p);
    prompt2.unshift(p);
  }
github taktiljs / taktil / bin / tasks / build.js View on Github external
const path = require('path');
const colors = require('colors/safe');

const taskName = colors.bold(colors.magenta(`[taktil]`));

module.exports = (project_root = '.', { production = false, watch = false }) => {
    process.chdir(project_root);

    const webpackPath = path.join(process.cwd(), 'node_modules', 'webpack');
    let webpack;
    try {
        webpack = require(webpackPath);
    } catch (e) {
        console.error(
            `\n${taskName} ${colors.bold(
                colors.red('ERROR: No local Webpack installation found.')
            )}\n${webpackPath}`
        );
        console.error(colors.cyan('\n    try "npm install webpack"\n'));
        return;
github troyharvey / jwt-cli / bin / jwt.js View on Github external
);

    console.log(colors.cyan('\n✻ Header'));
    console.log(colors.cyan(json.plain(token.decoded.header)));

    console.log(colors.yellow('\n✻ Payload'));
    console.log(colors.yellow(json.plain(token.decoded.payload)));

    const dates = {'iat': 'Issued At', 'nbf': 'Not Before', 'exp': 'Expiration Time'}
    for (const [field, name] of Object.entries(dates)) {
        if (token.decoded.payload.hasOwnProperty(field)) {
            console.log(colors.yellow(`   ${name}: `) + niceDate(token.decoded.payload[field]));
        }
    }

    console.log(colors.magenta('\n✻ Signature ' + token.decoded.signature));
}
github jamesmfriedman / rmwc / config / rewire.js View on Github external
webpack: (config, env) => {
    console.log(colors.magenta('Starting RMWC ❤️'));
    return pipe(
      fixLinting,
      addAliases,
      config => {
        //console.log(config);
        return config;
      }
    )(config);
  },
  storybook: (config, env) => pipe(addAliases)(config),
github stream-labs / streamlabs-obs / bin / release.js View on Github external
function info(msg) {
  sh.echo(colors.magenta(msg));
}
github ktty1220 / cheerio-httpcli / bin / chhc.js View on Github external
exec: function (args, $, res, body) {
        var n = parseInt(args[0], 10);
        if (isNaN(n)) {
          n = (type === 'number') ? 0 : null;
        }
        client.set(prop, n);
        showSuccess(
          'changed', colors.magenta(prop),
          'property to', colors.red(client[prop])
        );
      }
    };