notice(msg) { this.log(magenta(msg)); }
(async () => { const { version } = packageJson; console.log(chalk.magenta('Love the smell of a fresh JSUI release. \n'));
server.listen(process.env.PORT || app.get('port'), function() { var env = '\n[' + chalk.green(app.get('env')) + ']'; var port = chalk.magenta(app.get('port')); console.log(env + ' Listening on port ' + (process.env.PORT || port) + '...\n'); });
constructor(args, opts) { super(args, opts); this.template = template.bind(this); // define options this.option('yarn'); // define help text this.desc(chalk.magenta('\tOXY-GEN App Generator') + chalk.cyan('\n\n\tCreate an Electron app with create-react-app' + '\n\tand Rust (Web Assembly in Web Workers) all set' + '\n\tup and ready to go with simple speed test example.')); this._options.yarn.description = 'Installs dependencies with yarn instead of npm'; }
program .command('port <port>') .description('View programs that occupy the specified port.') .action(port => { if (!/^[0-9]*$/.test(port)) { const p = chalk.magenta(`${port}`) return print(`warn`, `✘ Unacceptable port specification: ${p}.`) } exec(`${checkPort(port)}`, (error, stdout, stderr) => { if (error) return print(`error`, `✘ Opps, Something Error: ${error}`) console.log(stdout) }) })
function row (name, pri, sec) { let primary = Number(pri.hz).toFixed(2) let pc = '' if (sec) { pc = Number(100 - (sec.hz / pri.hz * 100)).toFixed(2) if (pc < 0) { pc = chalk.magenta(pc) } else { pc = chalk.green(pc) } } return [chalk.blue(name), primary, pc] }
compiler.plugin('done', function(){ setTimeout(() => { spinner.stop(); console.log(chalk.bgGreen('\n √ Build done ') + '\n'); console.log(chalk.magenta(`[Tips] visit: http://localhost:${port}/${projectName}/`)); console.log(chalk.magenta(` : http://${ip()}:${port}/${projectName}/`) + '\n'); }, 0); });
function writeToConsole (json, obj) { const dt = chalk.magenta((new Date(obj.time)).toISOString()) const nameCol = chalk.magenta(obj.name) let output = `[${dt}][${levelCol(obj.level)}][${nameCol}](${obj.host}:${obj.pid}:${obj.file}) ${obj.msg}` if (obj.data) { output += '\n' + colorize(JSON.stringify(obj.data, null, 2)) // <=== Remove if you don't want data logged to the console. } console.log(output) // Extend by sending 'json' to your API or cloud storage. }
var execNext = function(){ let cmd = cmds.shift(); console.log(chalk.blue('run command: ') + chalk.magenta(cmd)); shell.exec(cmd, function(err){ if (err) { cb(err); } else { if (cmds.length) execNext(); else cb(null); } }); }
const logBookmarkWithTag = (bookmark) => { const tags = getTags(bookmark) const data = { prefix: bookmark.id, message: bookmark.title, suffix: magenta(tags) } if (bookmark.star) { star(data) } else { note(data) } }
const showServerAdress = (port, protocol) => { const hostname = chalk.magenta(`${protocol}://${os.hostname}:${port}`) const ipAdress = chalk.magenta(`${protocol}://${getIp()}:${port}`) const localAdress = chalk.magenta(`${protocol}://127.0.0.1:${port}`) qrcode.toString(`${protocol}://${getIp()}:${port}`, { type: 'terminal' }, (err, url) => { console.log(url) }) console.log(`\nListening on:\n✓ ${hostname} \n✓ ${ipAdress} \n✓ ${localAdress}`) }
// Called after webpack has finished generating the stats.json file function callback() { clearInterval(progress); process.stdout.write( ` \n\nOpen ${chalk.magenta('http://webpack.github.io/analyse/')} in your browser and upload the stats.json file! ${chalk.blue('\n(Tip: (\'CMD + double-click\') the link!)\n\n')} ` ); }
// Print a console UI header text. function showHeader (text) { console.log('') console.log(chalk.magenta(text + '…')) }
compiler.plugin('done', function(){ setTimeout(() => { spinner.stop(); console.log(chalk.bgGreen('\n √ Build done ') + '\n'); console.log(chalk.magenta(`[Tips] visit: http://localhost:${port}/${projectName}/`)); console.log(chalk.magenta(` : http://${ip()}:${port}/${projectName}/`) + '\n'); }, 0); });
compiler.plugin('done', function(){ setTimeout(() => { spinner.stop(); console.log(chalk.bgGreen('\n √ Build done ') + '\n'); console.log(chalk.magenta(`[Tips] visit: http://localhost:${port}/${projectName}/`)); console.log(chalk.magenta(` : http://${ip()}:${port}/${projectName}/`) + '\n'); }, 0); });