1.0.0 • Published 9 years ago

phantom-url v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

phantom-url Build Status

Node's native URL parser to work with PhantomJS.

Install

$ npm install phantom-url

Usage

Example

var url = require('phantom-url');

url('http://localhost:8080/index.html');
// {
//    "hash": "",
//    "host": "localhost:8080",
//    "hostname": "localhost",
//    "href": "http://localhost:8080/index.html",
//    "pathname": "/index.html",
//    "port": "8080",
//    "protocol": "http:",
//    "search": ""
// }

Why

  1. Node's url module is not available on the PhantomJS running context;
  2. Parsing URLs is a pain in the ass;
  3. I'm lazy.

License

MIT © Rafael Rinaldi