https://github.com/bendrucker/location-href
Simple Node-friendly interface to the browser's location
https://github.com/bendrucker/location-href
Last synced: about 1 year ago
JSON representation
Simple Node-friendly interface to the browser's location
- Host: GitHub
- URL: https://github.com/bendrucker/location-href
- Owner: bendrucker
- License: mit
- Created: 2015-08-05T22:16:00.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2018-11-13T19:30:17.000Z (over 7 years ago)
- Last Synced: 2024-11-18T22:39:18.872Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 5
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# location-href [](https://travis-ci.org/bendrucker/location-href)
> Simple Node-friendly interface to the browser's `location`
## Install
```
$ npm install --save location-href
```
## Usage
```js
var location = require('location-href')
location()
//=> http://the/current/location
location.set('http://new/location')
//=> browser transitions to new location
```
## API
#### `location()` -> `string`
Call to get the current location.
#### `location.set(href)` -> `undefined`
##### href
*Required*
Type: `string`
The new location.
## License
MIT © [Ben Drucker](http://bendrucker.me)