{"name":"parse-link-header","version":"2.0.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.1"},"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":"a7d59b6b44819a261c936b2374b792aa10ce3f2e","bugs":{"url":"https://github.com/thlorenz/parse-link-header/issues"},"_id":"parse-link-header@2.0.0","_nodeVersion":"14.17.6","_npmVersion":"6.14.4","dist":{"integrity":"sha512-xjU87V0VyHZybn2RrCX5TIFGxTVZE6zqqZWMPlIKiSKuWh/X5WZdt+w1Ki1nXB+8L/KtL+nZ4iq+sfI6MrhhMw==","shasum":"949353e284f8aa01f2ac857a98f692b57733f6b7","tarball":"http://registry-npm.ywwl.com/parse-link-header/download/parse-link-header-2.0.0.tgz","fileCount":7,"unpackedSize":12729,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhu1ynCRA9TVsSAnZWagAATj4P/iw34anyk3BEfjPzVEbr\nQcrc3bsFkNn+2Vs3jRSyEMtrj8mf6UhM7aMXFPsJL3HGJm73N4pScyoh0rQB\nd/SSoNtHN+1NCv3RgImGXC9XhSikxWT0Zikr09JgcLmfHIoi2Q0L/XdqZ9hY\nWLnQzIfuj7kzKFzgMwNQ51LwgeKWYTauuB9CFRqv60cuvR4MqHxah8d9gu2X\nlxHzlFDdctZ2QR3/5elANFDx9azNZglTB2y35kaln2jWv5WpVMyeXNQphUOp\nKeznGRCyhCJ3Nn6qj6v0E6CHVmMorVGNcHYG+ywnANGnY90fKTMt4YjRXHdA\n1UL8IfUEICweNJZxGQTcWO66kFwdZks+IzH2wunlGu3Rgwy5LViCtqRhx3kM\njdZkNlWNKeQn04m05tioWPyoRUuxVwzj5mFb6q2eSh1qfN5jMB2aWOZNuofy\n6IGBq0iYAweSB2ob39Vv8XYRX7FZymGKjrX1yTlLxVGoSwby7ZjNEm5gMMXP\nqg2Mekp5yUyoMdqRciBrc+/TgDDXpuk65BsX+BrbreV+s94WbztQMlx7m53x\nwa6raT5iTB0NVWgHsatMpJXJVsR+zeg3g6sARO1afySkurmwITNt0eflM5Qq\nYHSoAdGsIXpH3mX/RWf2SWPw6Oqr/KfLdjghtIYCp5mNPKgH8dSW8FUYn8Vv\nuD7E\r\n=6Ry/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIECgSOxS5uNIWhc9vOqcSABAPgeMWxRozbZlTTsrZcwbAiA+mAY5hi74/+xyXj5lenBZa27040fwff5YnwspB25XLQ=="}],"size":3717,"noattachment":false,"key":"/parse-link-header/-/parse-link-header-2.0.0.tgz"},"_npmUser":{"name":"thlorenz","email":"thlorenz10@gmail.com"},"directories":{},"maintainers":[{"name":"thlorenz","email":"thlorenz10@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/parse-link-header_2.0.0_1639668902959_0.05810592524918978"},"_hasShrinkwrap":false,"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":1639668903127,"_cnpm_publish_time":1639668903127,"dist-tags":{"latest":"2.0.0"}}