{"name":"parse-link-header","version":"0.2.1","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":"41c6afc40bee113f0e277e643309b87c50e25a01","bugs":{"url":"https://github.com/thlorenz/parse-link-header/issues"},"_id":"parse-link-header@0.2.1","_shasum":"51c29c12db66a8cda9bd64e76fc855c975df009c","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"thlorenz","email":"thlorenz@gmx.de"},"maintainers":[{"name":"thlorenz","email":"thlorenz@gmx.de"}],"dist":{"shasum":"51c29c12db66a8cda9bd64e76fc855c975df009c","tarball":"http://registry-npm.ywwl.com/parse-link-header/download/parse-link-header-0.2.1.tgz","integrity":"sha512-vQmtlFZ9xmtpx01Fj3d8aGfmV71MYMJnaOIjI88mGXBJnDjok7UULHbQ/I9seJO6ut1cPQ2bdKov1qc8wYP5ZQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID0d6vloL6cPskg5b/A0ZcPLktn+2JcewmzyYCzUZTiXAiEAqGK+9fM+sf5S546iDBIcg9kBxANhRDS2yLRUJctJac0="}],"size":2948,"noattachment":false,"key":"/parse-link-header/-/parse-link-header-0.2.1.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":1437072400045,"_cnpm_publish_time":1437072400045,"dist-tags":{"latest":"2.0.0"}}