link-parse-stream

streaming http link parser

Usage no npm install needed!

<script type="module">
  import linkParseStream from 'https://cdn.skypack.dev/link-parse-stream';
</script>

README

link-parse-stream

Build Status npm install

a streaming parser for http link header format

example

var linkParser = require('link-parse-stream')
  , request = require('hyperquest')

request('http://some-resource-with-link.headers', function(err, res) {
  if(err) {
    return console.log('lol')
  }

  res.pipe(linkParser()).on('data', function(data) {
    console.log(data) // {href: 'http://whatever.herpderp', rel: 'iunno'}
  })
})

license

MIT