Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

weblinks

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

weblinks - npm Package Compare versions

Comparing version 0.0.2 to 0.1.0

2

package.json
{
"name": "weblinks",
"version": "0.0.2",
"version": "0.1.0",
"description": "Paginate REST endpoints",

@@ -5,0 +5,0 @@ "main": "src/index.js",

# Weblinks for javascript
This project creates pagination links for REST endpoints.
This project creates pagination links for REST endpoints in accordance with [RFC5988](https://tools.ietf.org/html/rfc5988).

@@ -13,3 +13,3 @@ ## Install

### create
### Create

@@ -92,4 +92,90 @@ ```javascript

toString: [Function] },
linkHeader: '<http://website.com/?page=2&page_size=10>; rel="self",\n<http://website.com/?page=1&page_size=10>; rel="first",\n<http://website.com/?page=10&page_size=10>; rel="last",\n<http://website.com/?page=3&page_size=10>; rel="next",\n<http://website.com/?page=1&page_size=10>; rel="prev"' }
linkHeader: `<http://website.com/?page=2&page_size=10>; rel="self",
<http://website.com/?page=1&page_size=10>; rel="first",
<http://website.com/?page=10&page_size=10>; rel="last",
<http://website.com/?page=3&page_size=10>; rel="next",
<http://website.com/?page=1&page_size=10>; rel="prev"` }
```
### Parse Header
```javascript
const weblinks = require("weblinks");
const header = `<http://website.com/?page=2&page_size=10>; rel="self",
<http://website.com/?page=1&page_size=10>; rel="first",
<http://website.com/?page=10&page_size=10>; rel="last",
<http://website.com/?page=3&page_size=10>; rel="next",
<http://website.com/?page=1&page_size=10>; rel="prev"`;
{ url: 'http://website.com',
self:
Url {
protocol: 'http:',
slashes: true,
auth: null,
host: 'website.com',
port: null,
hostname: 'website.com',
hash: null,
query: { page: 2, page_size: 10 },
pathname: '/',
path: '/',
href: 'http://website.com/',
toString: [Function] },
first:
Url {
protocol: 'http:',
slashes: true,
auth: null,
host: 'website.com',
port: null,
hostname: 'website.com',
hash: null,
query: { page: 1, page_size: 10 },
pathname: '/',
path: '/',
href: 'http://website.com/',
toString: [Function] },
last:
Url {
protocol: 'http:',
slashes: true,
auth: null,
host: 'website.com',
port: null,
hostname: 'website.com',
hash: null,
query: { page: 10, page_size: 10 },
pathname: '/',
path: '/',
href: 'http://website.com/',
toString: [Function] },
prev:
Url {
protocol: 'http:',
slashes: true,
auth: null,
host: 'website.com',
port: null,
hostname: 'website.com',
hash: null,
query: { page: 1, page_size: 10 },
pathname: '/',
path: '/',
href: 'http://website.com/',
toString: [Function] },
next:
Url {
protocol: 'http:',
slashes: true,
auth: null,
host: 'website.com',
port: null,
hostname: 'website.com',
hash: null,
query: { page: 3, page_size: 10 },
pathname: '/',
path: '/',
href: 'http://website.com/',
toString: [Function] } }
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc