Skip to content

Instantly share code, notes, and snippets.

@jed
Created September 12, 2010 09:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jed/575954 to your computer and use it in GitHub Desktop.
Save jed/575954 to your computer and use it in GitHub Desktop.
require("url").parse("//google.com");
// { href: '//google.com'
// , pathname: '//google.com'
// }
@isaacs
Copy link

isaacs commented Sep 12, 2010

Pass true as the second arg. Since the common use case is parsing req.url, where //foo is a normal path, we decided to make that the default behavior. I should doc that though, my bad.

@jed
Copy link
Author

jed commented Sep 12, 2010

thanks, isaacs. sorry to bug ya with that.

@isaacs
Copy link

isaacs commented Sep 12, 2010

No worries ,its fair. I wrote the module after all ;)

@jed
Copy link
Author

jed commented Sep 12, 2010

(oh, and if you're hitting the docs, it's the third parameter, since the second is for the querystring...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment