Skip to content

Instantly share code, notes, and snippets.

@musubu
Created March 26, 2012 03:01
Show Gist options
  • Save musubu/2202583 to your computer and use it in GitHub Desktop.
Save musubu/2202583 to your computer and use it in GitHub Desktop.
escape and unescape in node.js
var querystring = require('querystring');
var original = 'http://example.com/product/abcde.html';
var escaped = querystring.escape(original);
console.log(escaped);
// http%3A%2F%2Fexample.com%2Fproduct%2Fabcde.html
var unescaped = querystring.unescape(escaped);
console.log(unescaped);
// http://example.com/product/abcde.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment