Skip to content

Instantly share code, notes, and snippets.

@indexzero
Created November 8, 2010 22:05
Show Gist options
  • Save indexzero/668356 to your computer and use it in GitHub Desktop.
Save indexzero/668356 to your computer and use it in GitHub Desktop.
$ node
> var url = require('url');
> var x = 'http://user:passwd@localhost:8080'
> var y = url.parse(x);
> y
{ href: 'http://user:passwd@localhost:8080',
protocol: 'http:',
slashes: true,
host: 'user:passwd@localhost:8080',
auth: 'user:passwd',
port: '8080',
hostname: 'localhost' }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment