Node server side for the angular-paginate-anything directive. Modify the http response for pagination, return 2 properties to use in a query
npm install node-paginate-anythingnode-paginate-anything
======================



nodejs server side module for angular-paginate-anything
This nodejs module add the required headers in the http response to paginate the items. This is a rewrite of clean_pagination
Bash
npm install node-paginate-anything
`$3
`JavaScript
var paginate = require('node-paginate-anything');
var queryParameters = paginate(ClientRequest, ServerResponse, totalItems, maxRangeSize);
mongooseQuery.limit(queryParameters.limit);
mongooseQuery.skip(queryParameters.skip);
`parameter | Description
---------------|---------------
ClientRequest | clientRequest object from the native http module or from an express app.
ServerResponse | ServerResponse object to modify before sending the http response.
totalItems | total number of items in the result set.
maxRangeSize | angular-paginate-anything send is own requested range in the request, this parameter specify the maximum value.
$3
* HTTP Content-Type agnoticism. Information about total items,
selected ranges, and next- previous-links are sent through headers.
It works without modifying your API payload in any way.
* Graceful degredation. Both client and server specify the maximum
page size they accept and communication gracefully degrades to
accomodate the lesser.
* Expressive retrieval. This approach, unlike the use of
per_page and
page` parameters, allows the client to request any (possibly unbounded)