How to use the ansicolors.brightYellow function in ansicolors

To help you get started, we’ve selected a few ansicolors 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 thlorenz / replpad / lib / dox / attach-dox.js View on Github external
'use strict';
var msee = require('msee');
var fs = require('fs');
var path = require('path');
var colors = require('ansicolors');

var divider = '\n' + colors.bgMagenta(colors.brightYellow('-- README --')) + '\n';

function pair (names, exts) {
  return names.reduce(function (acc, name) {
    return acc.concat(exts.map(function (ext) { return name + ext; }));
  }, []);
}

function getReadmePath (packagedir) {
  var tries = pair([ 'readme', 'README', 'Readme', 'ReadMe' ], [ '.md', '.markdown', '.MARKDOWN', '.MD' ]);
  var match;
  tries.some(function (x) {
    var p = path.join(packagedir, x);
    if (fs.existsSync(p)) return match = p, match;
  });

  return match;