How to use the util.puts function in util

To help you get started, we’ve selected a few util 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 ThomasBurleson / angularjs-logDecorator / demos / webserver / node_modules / http-proxy / examples / middleware / url-middleware.js View on Github external
'/google': { port: 80, host: 'google.com' } 
  })
).listen(8000);

//
// Target Http Server (to listen for requests on 'localhost')
//
http.createServer(function (req, res) {
  res.writeHead(200, { 'Content-Type': 'text/plain' });
  res.write('request successfully proxied to: ' + req.url + '\n' + JSON.stringify(req.headers, true, 2));
  res.end();
}).listen(9000);

// And finally, some colored startup output.
util.puts('http proxy server'.blue + ' started '.green.bold + 'on port '.blue + '8000'.yellow);
util.puts('http server '.blue + 'started '.green.bold + 'on port '.blue + '9000 '.yellow);
github No9 / harmon / node_modules / http-proxy / examples / http / custom-proxy-error.js View on Github external
// Tell the proxy to listen on port 8000
//
proxy.listen(8005);

//
// Listen for the `error` event on `proxy`.
proxy.on('error', function (err, req, res) {
  res.writeHead(500, {
    'Content-Type': 'text/plain'
  });
  
  res.end('Something went wrong. And we are reporting a custom error message.');
});


util.puts('http proxy server '.blue + 'started '.green.bold + 'on port '.blue + '8005 '.yellow + 'with custom error message'.magenta.underline);
github grippy / node-multivariate / scripts / production.js View on Github external
child.on('exit', function (code) {
                      // util.print('child process exited with code ' + code);
                      util.puts('Exiting application...') 
                    });
                }
github 0xfeedface / node_raptor / test / serialize.js View on Github external
serializer.on('end', function () {
    util.puts(triples);
});
github blackberry / BB10-Webworks-Packager / build / build.js View on Github external
function _done(error) {
    if (error) {
        util.puts("BB10-Webworks BUILD FAILED:\n" + error);
        process.exit(1);
    } else {
        util.puts("BB10-Webworks BUILD SUCCESS");
        process.exit();
    }
}
github grippy / node-multivariate / app / config.js View on Github external
function puts(s){util.puts(s)}
function inspect(o){puts(util.inspect(o))}
github jlongster / outlet / web / runtime.js View on Github external
var println = (function(msg){
return util["puts"](msg);
});
var pp = (function(obj){
github cloudkick / whiskey / lib / reporters / coverage / cli.js View on Github external
var file = cov.files[name];
    util.print('   | ' + utils.rpad(name, 40));
    util.print(' | ' + utils.lpad(file.coverage, 8));
    util.print(' | ' + utils.lpad(file.LOC, 4));
    util.print(' | ' + utils.lpad(file.SLOC, 4));
    util.print(' | ' + utils.lpad(file.totalMisses, 6));
    util.print(' |\n');
  }
  util.puts(sep);
  util.print('     ' + utils.rpad('', 40));
  util.print(' | ' + utils.lpad(cov.coverage, 8));
  util.print(' | ' + utils.lpad(cov.LOC, 4));
  util.print(' | ' + utils.lpad(cov.SLOC, 4));
  util.print(' | ' + utils.lpad(cov.totalMisses, 6));
  util.print(' |\n');
  util.puts(lastSep);
};
github aemkei / jslint-tmbundle / Support / jslint.js View on Github external
function finish_file(){
  sys.puts(body);
}