How to use the terminal-kit.terminal.red function in terminal-kit

To help you get started, we’ve selected a few terminal-kit 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 DefinitelyTyped / DefinitelyTyped / types / terminal-kit / terminal-kit-tests.ts View on Github external
autoComplete as ac,
  getDetectedTerminal,
  ScreenBufferHD,
  ScreenBuffer,
  Terminal
} from "terminal-kit";
import "node";
import * as fs from "fs";

new t.Rect({width: 4, height: 4});
// The term() function simply output a string to stdout, using current style
// output "Hello world!" in default terminal's colors
t.terminal("Hello world!\n");

// This output 'red' in red
term.red("red");

// This output 'bold' in bold
term.bold("bold");

// output 'mixed' using bold, underlined & red, exposing the style-mixing syntax
term.bold.underline.red("mixed");

// printf() style formatting everywhere:
// this will output 'My name is Jack, I'm 32.' in green
term.green("My name is %s, I'm %d.\n", "Jack", 32);

// Since v0.16.x, style markup are supported as a shorthand.
// Those two lines produce the same result.
term("My name is ")
  .red("Jack")(" and I'm ")
  .green("32\n");
github Bearer / bearer-js / packages / legacy-cli / scripts / check-version.js View on Github external
const term = require('terminal-kit').terminal
const updateNotifier = require('update-notifier')

const pkg = require('../../package.json')
const version = pkg.engines.node

// Check if a new version is available
const notifier = updateNotifier({
  pkg,
  updateCheckInterval: 1000 * 60 * 60 * 24 // everyday for the moment
})
notifier.notify()

if (!semver.satisfies(process.version, version)) {
  term.white('Bearer: ')
  term.red(`Required node version ${version} not satisfied with current version ${process.version}.`)
  term('\n')
  process.exit(1)
}
github DefinitelyTyped / DefinitelyTyped / types / terminal-kit / terminal-kit-tests.ts View on Github external
(error: any, result: any) => {
      if (result) {
        term.green("'Yes' detected! Good bye!\n");
      } else {
        term.red("'No' detected, are you sure?\n");
        question();
      }
    }
  );
github criteo / loop / lib / term.js View on Github external
process.on('uncaughtException', err => {
    terminal.red(`uncaughtException: ${err.message}\n`)
    console.error(err.stack)
    exit()
  })
}
github cronvel / http-requester / lib / core.js View on Github external
server.on( 'error' , ( error ) => {

		if ( error.code === 'EACCES' ) {
			term.red( "Error EACCES: opening port %i is forbidden.\n" , serverConf.port ) ;
			term.red( "Please use the --port option to specify another port.\n" ) ;
		}
		else if ( error.code === 'EADDRINUSE' ) {
			term.red( "Error EADDRINUSE: port %i is already used by another program on your system.\n" , serverConf.port ) ;
			term.red( "Please use the --port option to specify another port.\n" ) ;
		}
		else {
			term.red( error.toString() + '\n' ) ;
		}

		process.exit( 1 ) ;
	} ) ;
} ;
github cronvel / http-requester / lib / core.js View on Github external
server.on( 'error' , ( error ) => {

		if ( error.code === 'EACCES' ) {
			term.red( "Error EACCES: opening port %i is forbidden.\n" , serverConf.port ) ;
			term.red( "Please use the --port option to specify another port.\n" ) ;
		}
		else if ( error.code === 'EADDRINUSE' ) {
			term.red( "Error EADDRINUSE: port %i is already used by another program on your system.\n" , serverConf.port ) ;
			term.red( "Please use the --port option to specify another port.\n" ) ;
		}
		else {
			term.red( error.toString() + '\n' ) ;
		}

		process.exit( 1 ) ;
	} ) ;
} ;
github sogehige / sogeBot / tools / cleanup.js View on Github external
term.yesOrNo({ yes: ['y'], no: ['n', 'ENTER'] }, (error, result) => {
    if (error) process.exit(error)

    if (result) {
      areYouSure()
    } else {
      term.red("'No' detected, backup your DB before cleanup!\n")
      process.exit()
    }
  })
}
github Bearer / bearer-js / packages / legacy-cli / src / lib / cliOutput.ts View on Github external
function outputError(error) {
  if (typeof error !== 'undefined' && error.message) {
    term.white('Error: ')
    term.red(error.message)
    term('\n')
  }
}
github Bearer / bearer-js / packages / legacy-cli / src / lib / cliOutput.ts View on Github external
emitter.on('start:failed', ({ error }) => {
    term.red('An error occured')
    term('\n')
    term.white('    Error: ')
    term.red(error)
    term('\n')
  })