How to use the ansi-colors.inverse function in ansi-colors

To help you get started, we’ve selected a few ansi-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 swissquote / crafty / packages / crafty-runner-webpack / src / utils / formatWebpackMessages.js View on Github external
// It is misleading (and unrelated to the warnings) so we clean it up.
    // It is only useful for syntax errors but we have beautiful frames for them.
    return line.indexOf(" @ ") !== 0;
  });

  // Cleans up verbose "module not found" messages for files and packages.
  if (lines[1] && lines[1].indexOf("Module not found: ") === 0) {
    lines = [
      lines[0],
      lines[1]
        .replace("Error: ", "")
        .replace("Module not found: Cannot find file:", "Cannot find file:")
    ];
  }

  lines[0] = colors.inverse(lines[0]);

  message = lines.join("\n");
  // Internal stacks are generally useless so we strip them... with the
  // exception of stacks containing `webpack:` because they're normally
  // from user code generated by Webpack. For more information see
  // https://github.com/facebook/create-react-app/pull/1050
  message = message.replace(
    /^\s*at\s((?!webpack:).)*:\d+:\d+[\s)]*(\n|$)/gm,
    ""
  ); // at ... ...:x:y
  message = message.replace(/^\s*at\s(\n|$)/gm, ""); // at 
  lines = message.split("\n");

  // Remove duplicated newlines
  lines = lines.filter(
    (line, index, arr) =>
github NewFuture / miniprogram-build / src / task.js View on Github external
taskLog(rainbow("↑↑↑↑↑↑"), colors.greenBright.bold(colors.symbols.check + ' All compilation tasks done!'), rainbow("↑↑↑↑↑↑"))
))
// 重新生成文件
gulp.task('build', gulp.series('clean', 'compile'));
// 监测文件修改
gulp.task('watch', gulp.series(
    gulp.parallel('js-watch', 'wxs-watch', 'wxss-watch', 'wxml-watch', 'json-watch', 'image-watch', 'copy-watch', 'npm-watch'),
    taskLog(colors.greenBright.bold('\tAll watch tasks started !')))
);

//开发模式
gulp.task('dev', gulp.series(
    'try-quit',
    'clean', 'compile',
    gulp.parallel('try-open', 'watch'),
    taskLog(colors.inverse(rainbow('all tasks are ready, waiting for code change ...')))
));

gulp.on('error', console.trace);
gulp.on('error', error('gulp'));
github OpenUserJS / OpenUserJS.org / dev / postinstall.js View on Github external
async.waterfall(tasks, function (aErr, aResults) {
  if (aErr) {
    console.error(
      colors.inverse(colors.red('Project dependency error!\n\n')),
      'Code ' + aErr.code + '\n',
      aErr.message
    );
    return;
  }

  aResults.push(colors.cyan('Completed checking project dependencies'));

  console.log(aResults.join('\n'));
});
github tabarra / txAdmin / src / scripts / setup.js View on Github external
fs.writeFileSync(`${profilePath}/config.json`, jsonConfig);

        if(!isLinux){
            let batch = `@echo off\r\n node src ${serverProfile}\r\n pause`;
            fs.writeFileSync(`start_${serverProfile}.bat`, batch);
        }
    } catch (error) {
        logError(`Error setting up folder structure in '${profilePath}'`, context);
        logError(error);
        process.exit();
    }
    printDivider();

    //Printing goodbye :)
    logOk(`Server profile saved in '${profilePath}'`, context);
    let cmd = ac.inverse(` node src ${serverProfile} `);
    logOk(`To start txAdmin with this profile run: ${cmd}`, context);
    if(!isLinux){
        let cmd2 = ac.inverse(` txAdmin/start_${serverProfile}.bat `);
        logOk(`You can also execute: ${cmd2}`, context);
    }
    process.exit();
})();
github smontanari / code-forensics / lib / runtime / env_config_reader.js View on Github external
var deprecationWarning = function(msg) {
  //eslint-disable-next-line no-console
  console.log(ansi.inverse(msg));
};
github smontanari / code-forensics / lib / runtime / file_config_reader.js View on Github external
var deprecationWarning = function(msg) {
  //eslint-disable-next-line no-console
  console.log(ansi.inverse(msg));
};
github aurelia / cli / build / tasks / release-checks / step-runner.js View on Github external
run() {
    logger.info(c.inverse(`Executing ${this.step.getTitle()}`));
    return this.step.execute(this.context);
  }
};
github aurelia / cli / lib / commands / new / command.js View on Github external
function cmd(str) {
  return c.inverse(' ' + str + ' ');
}
github aurelia / cli / build / tasks / release-check.js View on Github external
async(dir, i) => {
        logger.info(c.inverse(`Executing ${i + 1}/${dirs.length} ${dir}`));

        const context = {
          suite: dir,
          resultOutputFolder: path.join(resultOutputFolder, dir),
          workingDirectory: path.join(testDir, dir)
        };
        const suiteRunner = new SuiteRunner(context, reporter);

        try {
          const result = await suiteRunner.run();
          await writeLog(context.resultOutputFolder, 'log-full.txt');
          return result;
        } catch (e) {
          logger.error(e);
          throw e;
        }

ansi-colors

Easily add ANSI colors to your text and symbols in the terminal. A faster drop-in replacement for chalk, kleur and turbocolor (without the dependencies and rendering bugs).

MIT
Latest version published 3 years ago

Package Health Score

74 / 100
Full package analysis