github-pagination
A simple js lib for parse GitHub's pagination info from API's response.
Installation
$ npm install github-pagination --save
or
$ bower install github-pagination --save
Example
in node.js / io.js
var octopage = ; var test = '<https://api.github.com/search/code?q=addClass+user%3Amozilla&page=15>; rel="next", <https://api.github.com/search/code?q=addClass+user%3Amozilla&page=34>; rel="last", <https://api.github.com/search/code?q=addClass+user%3Amozilla&page=1>; rel="first", <https://api.github.com/search/code?q=addClass+user%3Amozilla&page=13>; rel="prev"'; console;// { next: '15', last: '34', first: '1', prev: '13' }
in borwser
link this script and then,
License
MIT © Leigh Zhu