- Notifications
You must be signed in to change notification settings - Fork3
jfromaniello/parse-links
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Parse aLinks header into a javascript object.
I'll no longer maintain this repository.li is a fork from this repository and allows parse and stringify.
npm install parse-links
varparseLinks=require('parse-links');varsomeLinksHeader='</api/users?page=0&per_page=2>; rel="first", '+'</api/users?page=1&per_page=2>; rel="next", '+'</api/users?page=3&per_page=2>; rel="last"';console.log(parseLinks(someLinksHeader));// This will print:// {// first: '/api/users?page=0&per_page=2',// next: '/api/users?page=1&per_page=2',// last: '/api/users?page=3&per_page=2'// }
MIT!