COMPILED = false;

var goog = require('closure').Closure({CLOSURE_BASE_PATH: 'closure/goog/'});

goog.require('goog.array');
goog.require('goog.proto2.PbLiteSerializer');
goog.require('goog.string');
goog.require('goog.string.StringBuffer');

goog.loadScript('closure/goog/i18n/phonenumbers/phonemetadata.pb.js');
goog.loadScript('closure/goog/i18n/phonenumbers/phonenumber.pb.js');
goog.loadScript('closure/goog/i18n/phonenumbers/metadata.js');
goog.loadScript('closure/goog/i18n/phonenumbers/phonenumberutil.js');

var phoneUtil = goog.global.i18n.phonenumbers.PhoneNumberUtil.getInstance();
var PNF = goog.global.i18n.phonenumbers.PhoneNumberFormat;

var express = require('express');
var app = express.createServer(express.logger());

app.get('/', function(req, response) {
  var number = req.param('number');
  var country_code = req.param('country_code');

  var number = phoneUtil.parseAndKeepRawInput(number, country_code);
  var inumber = phoneUtil.format(number, PNF.E164)
  
  response.send(inumber);
});

var port = process.env.PORT || 3000;
app.listen(port, function() {
  console.log("Listening on " + port);
});

@@ -234,16 +234,43 @@
 uffer');
+%0Agoog.require('goog.json');
 %0A%0Agoog.l
@@ -672,16 +672,73 @@
 rFormat;
+%0Avar PNT = goog.global.i18n.phonenumbers.PhoneNumberType;
 %0A%0Avar ex
@@ -1063,35 +1063,1002 @@
 164)
-%0A  %0A  response.send(inumber
+;%0A  var national = phoneUtil.format(number, PNF.NATIONAL);%0A  %0A  var is_valid = phoneUtil.isValidNumber(number);%0A  var type = 'UNKNOWN';%0A  %0A  switch (phoneUtil.getNumberType(number)) %7B%0A    case PNT.FIXED_LINE:%0A      type = 'FIXED_LINE';%0A      break;%0A    case PNT.MOBILE:%0A      type ='MOBILE';%0A      break;%0A    case PNT.FIXED_LINE_OR_MOBILE:%0A      type ='FIXED_LINE_OR_MOBILE';%0A      break;%0A    case PNT.TOLL_FREE:%0A      type ='TOLL_FREE';%0A      break;%0A    case PNT.PREMIUM_RATE:%0A      type ='PREMIUM_RATE';%0A      break;%0A    case PNT.SHARED_COST:%0A      type ='SHARED_COST';%0A      break;%0A    case PNT.VOIP:%0A      type ='VOIP';%0A      break;%0A    case PNT.PERSONAL_NUMBER:%0A      type ='PERSONAL_NUMBER';%0A      break;%0A    case PNT.PAGER:%0A      type ='PAGER';%0A      break;%0A    case PNT.UAN:%0A      type ='UAN';%0A      break;%0A    case PNT.UNKNOWN:%0A      type ='UNKNOWN';%0A      break;%0A  %7D%0A  %0A  var j = goog.json.serialize(%7Be164: inumber, national: national, valid: is_valid, type: type%7D);%0A  response.send(j
 );%0A%7D

Return more info on the number