How to use the ansi-styles.bgGreen function in ansi-styles

To help you get started, we’ve selected a few ansi-styles 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 millermedeiros / disparity / disparity.js View on Github external
'use strict';

var stringDiff = require('diff');
var ansi = require('ansi-styles');

// ---

exports.unified = unified;
exports.unifiedNoColor = unifiedNoColor;
exports.chars = chars;
exports.removed = 'removed';
exports.added = 'added';
exports.colors = {
  charsRemoved: ansi.bgRed,
  charsAdded: ansi.bgGreen,
  removed: ansi.red,
  added: ansi.green,
  header: ansi.yellow,
  section: ansi.magenta,
};

// ---

function chars(str1, str2, opts) {
  if (str1 === str2) {
    return '';
  }

  opts = opts || {};

  // how many lines to add before/after the chars diff
github testdouble / ought / lib / concordance-options.js View on Github external
},
  regexp: {
    source: { open: ansiStyles.blue.open + '/', close: '/' + ansiStyles.blue.close },
    flags: ansiStyles.yellow
  },
  stats: { separator: forceColor.grey('---') },
  string: {
    open: ansiStyles.blue.open,
    close: ansiStyles.blue.close,
    line: { open: forceColor.blue('\''), close: forceColor.blue('\'') },
    multiline: { start: forceColor.blue('`'), end: forceColor.blue('`') },
    controlPicture: ansiStyles.grey,
    diff: {
      insert: {
        open: ansiStyles.bgGreen.open + ansiStyles.black.open,
        close: ansiStyles.black.close + ansiStyles.bgGreen.close
      },
      delete: {
        open: ansiStyles.bgRed.open + ansiStyles.black.open,
        close: ansiStyles.black.close + ansiStyles.bgRed.close
      },
      equal: ansiStyles.blue,
      insertLine: {
        open: ansiStyles.green.open,
        close: ansiStyles.green.close
      },
      deleteLine: {
        open: ansiStyles.red.open,
        close: ansiStyles.red.close
      }
    }
  },
github serverless / components / registry / github-webhook / src / diff-options.js View on Github external
open: ansiStyles.blue.open + '/',
      close: '/' + ansiStyles.blue.close
    },
    flags: ansiStyles.yellow
  },
  stats: { separator: forceColor.grey('---') },
  string: {
    open: ansiStyles.white.open,
    close: ansiStyles.white.close,
    line: { open: forceColor.white("'"), close: forceColor.white("'") },
    multiline: { start: forceColor.white('`'), end: forceColor.white('`') },
    controlPicture: ansiStyles.grey,
    diff: {
      insert: {
        open: ansiStyles.bgGreen.open + ansiStyles.black.open,
        close: ansiStyles.black.close + ansiStyles.bgGreen.close
      },
      delete: {
        open: ansiStyles.bgRed.open + ansiStyles.black.open,
        close: ansiStyles.black.close + ansiStyles.bgRed.close
      },
      equal: ansiStyles.white,
      insertLine: {
        open: ansiStyles.green.open,
        close: ansiStyles.green.close
      },
      deleteLine: {
        open: ansiStyles.red.open,
        close: ansiStyles.red.close
      }
    }
  },
github alexkuz / nyan-progress-webpack-plugin / index.js View on Github external
var webpack = require('webpack');

require('object.assign').shim();

var bold = AnsiStyles.bold;
var inverse = AnsiStyles.inverse;

var red = AnsiStyles.red;
var yellow = AnsiStyles.yellow;
var green = AnsiStyles.green;
var blue = AnsiStyles.blue;
var magenta = AnsiStyles.magenta;

var bgRed = AnsiStyles.bgRed;
var bgYellow = AnsiStyles.bgYellow;
var bgGreen = AnsiStyles.bgGreen;
var bgBlue = AnsiStyles.bgBlue;

var cursorUp = AnsiEscapes.cursorUp;
var cursorDown = AnsiEscapes.cursorDown;
var eraseEndLine = AnsiEscapes.eraseEndLine;
var cursorSavePosition = AnsiEscapes.cursorSavePosition;
var cursorRestorePosition = AnsiEscapes.cursorRestorePosition;

var width = 50;
var stdoutLineCount = 0;

var nyanTemplate = {
  ascii: [
    ' ,--------,     ',
    ' │▗▝ ▞ ▝ ˄---˄  ',
    '~│ ▞  ▞ ❬.◕‿‿◕.❭',