1.0.0 • Published 9 years ago

locay v1.0.0

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

locay

A window.location simulator for the browser and beyond

A precise simulation of the location object found in a browser near you.

Install

from npm

npm install --save locay

Example

import Location from 'location';

let l = new Location('http://www.example.com:3000/some/path?some=query#somehash');
/**
 * Results in:
 *
 * {
 *   href: 'http://www.example.com:3000/some/path?some=query#somehash',
 *   host: 'www.example.com:3000',
 *   hash: '#somehash',
 *   port: '3000',
 *   search: '?some=query',
 *   protocol: 'http:',
 *   pathname: '/some/path',
 *   hostname: 'www.example.com',
 *   origin: 'http://www.example.com:3000'
 * };
 */

License

MIT