@segment/canonical
Version:
Get the current page's canonical URL.
28 lines (20 loc) • 625 B
Markdown
# canonical
[](https://circleci.com/gh/segmentio/canonical)
[](https://codecov.io/gh/segmentio/canonical)
Returns the canonical URL for the page.
## Installation
```js
$ npm install @segment/canonical
```
## Example
```html
<html>
<head>
<link rel="canonical" href="http://example.com" />
</head>
</html>
```
```js
var canonical = require('canonical');
canonical(); // http://example.com
```