Example #1
0
  value: function () {
    console.log(highlight(cowsay.say({
	    text : this.toString(),
	    e : "oO",
	    T : "U "
	}), {
      // optional options
      language: 'javascript', // will auto-detect if omitted
      theme: 'monokai' // a highlight.js theme
    }));
  },
Example #2
0
        formatter: function(lev, msg, meta) {

          // TODO: fix the formatter when https://github.com/flatiron/winston/pull/422 is merged

          var parts = msg.split(' ');
          var ident = '['+parts.shift()+']';
          var message = highlight(parts.join(' '), {
            theme: meta.theme || 'railscasts',
            language: meta.language || 'bash'
          }).replace(/\n|\r/g, ' ').replace(/\s{2,}/g, ' ');
          var timestamp = '['+moment().format('YYYY/MM/DD hh:mm:ss')+']';
          var level = '['+lev+']';
          return clc.xterm(8)(timestamp)+clc[colors[lev]](level)+clc.cyan(ident)+' '+message;
        }
Example #3
0
        .then(function() {
            console.log();
            console.log();
            console.log('--------------------------------------------------------');
            console.log('                      ' + module + '.js');
            console.log('--------------------------------------------------------');
            console.log();
            console.log(highlight(fs.readFileSync(module + '.js', "utf8"), {
                // optional options
                language: 'javascript', // will auto-detect if omitted
                theme: 'tomorrow-night-bright' // a highlight.js theme
            }));

            console.log('output:');
            console.log('--------------------------------------------------------');
            console.log();
            return System
                .import(module)
                .then(function() {
                    return new BB(function(resolve) {
                        process.nextTick(function() {

                            console.log();
                            console.log();

                            prompt.start();
                            prompt.get(['enter to continue'], function(e, r) {

                                console.log();
                                console.log();
                                console.log();

                                if ( e || '' !== r['enter to continue']) {
                                    console.log('Not enter pressed.... exiting!');
                                    process.exit();
                                }

                               clear();

                                resolve();
                            });
                        });
                    });
                })
        })