{"name":"parse-link-header","version":"0.3.0","description":"Parses a link header and returns paging information for each contained link.","main":"index.js","scripts":{"test":"tap test/*.js"},"repository":{"type":"git","url":"git://github.com/thlorenz/parse-link-header.git"},"homepage":"https://github.com/thlorenz/parse-link-header","dependencies":{"xtend":"~4.0.0"},"devDependencies":{"tape":"~1.0.3","tap":"~0.4.3"},"keywords":["parse","link","header","weblink","web","link","rel"],"author":{"name":"Thorsten Lorenz","email":"thlorenz@gmx.de","url":"http://thlorenz.com"},"license":"MIT","engine":{"node":">=0.6"},"testling":{"files":"test/*.js","browsers":["ie/8..latest","firefox/17..latest","firefox/nightly","chrome/22..latest","chrome/canary","opera/12..latest","opera/next","safari/5.1..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]},"gitHead":"08ec888a824ba5fb53c7804f5ff697f4adef8dc6","bugs":{"url":"https://github.com/thlorenz/parse-link-header/issues"},"_id":"parse-link-header@0.3.0","_shasum":"2f5ef1826cbae9cfa4032b36de55dc0bdf2c549f","_from":".","_npmVersion":"2.13.0","_nodeVersion":"2.4.0","_npmUser":{"name":"thlorenz","email":"thlorenz@gmx.de"},"maintainers":[{"name":"thlorenz","email":"thlorenz@gmx.de"}],"dist":{"shasum":"2f5ef1826cbae9cfa4032b36de55dc0bdf2c549f","tarball":"http://registry-npm.ywwl.com/parse-link-header/download/parse-link-header-0.3.0.tgz","integrity":"sha512-7YZsFrZIzmpkfZA1Yyt7lAcSbb953R8RkmTDkOev0FO9fCySGWVOiJ4N7sDVpLkE4JoRbXtufSYk/hna2aCVDw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCVS/w6QT1YZZzktxg8JOItVeAsnMKyISr0axHtf7+ofwIgRo9v5REox6jY4sAce30xqqELZY4WmHU70+nJN+hKu0c="}],"size":2999,"noattachment":false,"key":"/parse-link-header/-/parse-link-header-0.3.0.tgz"},"directories":{},"readme":"# parse-link-header [![build status](https://secure.travis-ci.org/thlorenz/parse-link-header.png)](http://travis-ci.org/thlorenz/parse-link-header)\n\n[![testling badge](https://ci.testling.com/thlorenz/parse-link-header.png)](https://ci.testling.com/thlorenz/parse-link-header)\n\nParses a link header and returns paging information for each contained link.\n\n```js\nvar parse = require('parse-link-header');\n\nvar linkHeader =\n  '<https://api.github.com/user/9287/repos?page=3&per_page=100>; rel=\"next\", ' +\n  '<https://api.github.com/user/9287/repos?page=1&per_page=100>; rel=\"prev\"; pet=\"cat\", ' +\n  '<https://api.github.com/user/9287/repos?page=5&per_page=100>; rel=\"last\"'\n\nvar parsed = parse(linkHeader);\nconsole.log(parsed);\n```\n\n```js\n{ next:\n   { page: '3',\n     per_page: '100',\n     rel: 'next',\n     url: 'https://api.github.com/user/9287/repos?page=3&per_page=100' },\n  prev:\n   { page: '1',\n     per_page: '100',\n     rel: 'prev',\n     pet: 'cat',\n     url: 'https://api.github.com/user/9287/repos?page=1&per_page=100' },\n  last:\n   { page: '5',\n     per_page: '100',\n     rel: 'last',\n     url: 'https://api.github.com/user/9287/repos?page=5&per_page=100' } }\n```\n\n## Installation\n\n    npm install parse-link-header\n\n## API\n\n***parseLinkHeader(linkHeader : String) : Object***\n\nParses the given link header containing [web links](http://tools.ietf.org/html/rfc5988) and returns an object keyed by\nthe `rel` property that contains information about each link.\n\n### Environmental Variables\n\nTo avoid redundantly parsing of extremely long (invalid) input, the package uses 2 env variabes:\n\n`PARSE_LINK_HEADER_MAXLEN` - Sets the number of characters the input should be limited to - longer inputs will not be handled. Defaults to `2000`.\n\n`PARSE_LINK_HEADER_THROW_ON_MAXLEN_EXCEEDED` - Defines behavior for when the `PARSE_LINK_HEADER_MAXLEN` parameter is exceeded. if defined, an error will be thrown; if it's `null`, the function fails silently by returning `null`. Defaults to `null`.\n\n### Formatting a link header\n\nThe purpose of this module is to parse the link header information. To format an object generated by this module back to the link header string, use the [format-link-header](https://github.com/jonathansamines/format-link-header) module.\n","publish_time":1438055626104,"_cnpm_publish_time":1438055626104,"dist-tags":{"latest":"2.0.0"}}