The response from api.github has a response header with Link.
How should I use it? it return a string like this
<https://api.github.com/user/repos?per_page=10&page=2>; rel="next", <https://api.github.com/user/repos?per_page=10&page=4>; rel="last"
it need to parse by myselef?

You need to parse it yourself. Here's how to do it with split, reduce, and a regular expression.
let linkHeaders = '<https://api.github.com/user/repos?per_page=10&page=2>; rel="next", <https://api.github.com/user/repos?per_page=10&page=4>; rel="last"'
let parts = linkHeaders.split(',').reduce((acc, link) => {
let match = link.match(/<(.*)>; rel="(\w*)"/)
let url = match[1]
let rel = match[2]
acc[rel] = url
return acc;
}, {})
console.log(parts)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With