Node.js examples for String:URL String
Encode and decode URL
// from http://phpjs.org/functions/urlencode:573 util.urlencode = function(str) { str = (str + '').toString(); return encodeURIComponent(str).replace(/!/g, '%21').replace(/'/g, '%27').replace(/\(/g, '%28').replace(/\)/g, '%29').replace(/\*/g, '%2A').replace(/%20/g, '+'); } // from http://phpjs.org/functions/urldecode:572 util.urldecode = function(str) { return decodeURIComponent((str + '').replace(/\+/g, '%20')); }