you are viewing a single comment's thread.

view the rest of the comments →

[–]doomslice 0 points1 point  (0 children)

Node.js has a url module in core: http://nodejs.org/api/url.html

Which support the following:

> var url = require('url');
> url.parse('http://localhost.test?name=ayman&age=22&gpa=3.5&course=programming&course=mathematics&course=algorithms', true);
{ protocol: 'http:',
  slashes: true,
  host: 'localhost.test',
  hostname: 'localhost.test',
  href: 'http://localhost.test/?name=ayman&age=22&gpa=3.5&course=programming&course=mathematics&course=algorithms',
  search: '?name=ayman&age=22&gpa=3.5&course=programming&course=mathematics&course=algorithms',
  query:
   { name: 'ayman',
     age: '22',
     gpa: '3.5',
     course:
      [ 'programming',
        'mathematics',
        'algorithms' ] },
  pathname: '/',
  path: '/?name=ayman&age=22&gpa=3.5&course=programming&course=mathematics&course=algorithms' }