Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/junosuarez/node-link-rel-parser

parse HTTP link headers and HTML links
https://github.com/junosuarez/node-link-rel-parser

Last synced: 8 days ago
JSON representation

parse HTTP link headers and HTML links

Awesome Lists containing this project

README

        

# link-rel-parser
parse HTTP link headers and HTML links

## usage
```js
var linkRelParser = require('link-rel-parser')
e.g.
linkRelParser('http://log.jden.us', function (e, links) {
console.log(e, links)
})
```

links is an object like:

```js
{
shortcut: ['http://assets.tumblr.com/images/default_avatar/cube_closed_128.png' ],
icon: [ 'http://assets.tumblr.com/images/default_avatar/cube_closed_128.png' ],
alternate: [ 'android-app://com.tumblr/tumblr/x-callback-url/blog?blogName=logjdenus' ],
stylesheet: [ 'http://assets.tumblr.com/fonts/gibson/stylesheet.css?v=3']
}

```

## installation

$ npm install link-rel-parser

## running the tests

From package root:

$ npm install
$ npm test

## contributors

- jden

## license

ISC. (c) MMXIV jden . See LICENSE.md