{"id":15573237,"url":"https://github.com/polo2ro/node-paginate-anything","last_synced_at":"2025-04-24T02:09:19.809Z","repository":{"id":18090276,"uuid":"21155750","full_name":"polo2ro/node-paginate-anything","owner":"polo2ro","description":"nodejs server side module for angular-pagninate-anything","archived":false,"fork":false,"pushed_at":"2017-01-01T14:51:55.000Z","size":23,"stargazers_count":17,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-24T02:09:13.270Z","etag":null,"topics":["angular","nodejs","paginate"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/polo2ro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-06-24T07:18:43.000Z","updated_at":"2023-08-21T20:39:41.000Z","dependencies_parsed_at":"2022-09-24T04:02:07.264Z","dependency_job_id":null,"html_url":"https://github.com/polo2ro/node-paginate-anything","commit_stats":{"total_commits":43,"total_committers":7,"mean_commits":6.142857142857143,"dds":0.5348837209302326,"last_synced_commit":"c2d25b9e8df121d3a2b563ae1ef3f70d30634a26"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polo2ro%2Fnode-paginate-anything","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polo2ro%2Fnode-paginate-anything/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polo2ro%2Fnode-paginate-anything/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polo2ro%2Fnode-paginate-anything/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/polo2ro","download_url":"https://codeload.github.com/polo2ro/node-paginate-anything/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250546082,"owners_count":21448260,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","nodejs","paginate"],"created_at":"2024-10-02T18:11:27.526Z","updated_at":"2025-04-24T02:09:19.785Z","avatar_url":"https://github.com/polo2ro.png","language":"JavaScript","readme":"node-paginate-anything\n======================\n\n[![Build Status](https://travis-ci.org/polo2ro/node-paginate-anything.svg?branch=master)](https://travis-ci.org/polo2ro/node-paginate-anything)\n[![Dependency Status](https://david-dm.org/polo2ro/node-paginate-anything.svg)](https://david-dm.org/polo2ro/node-paginate-anything)\n[![devDependency Status](https://david-dm.org/polo2ro/node-paginate-anything/dev-status.svg)](https://david-dm.org/polo2ro/node-paginate-anything#info=devDependencies)\n\nnodejs server side module for [angular-paginate-anything](https://github.com/begriffs/angular-paginate-anything)\n\nThis nodejs module add the required headers in the http response to paginate the items. This is a rewrite of [clean_pagination](https://github.com/begriffs/clean_pagination)\n\n\n### Install\n```Bash\n  npm install node-paginate-anything\n```\n\n### Usage\n\n```JavaScript\n  var paginate = require('node-paginate-anything');\n  \n  var queryParameters = paginate(ClientRequest, ServerResponse, totalItems, maxRangeSize);\n  \n  mongooseQuery.limit(queryParameters.limit);\n  mongooseQuery.skip(queryParameters.skip);\n```\n\n\n\nparameter      | Description\n---------------|---------------\nClientRequest  | [clientRequest](http://nodejs.org/api/http.html#http_class_http_clientrequest) object from the native http module or from an express app. \nServerResponse | [ServerResponse](http://nodejs.org/api/http.html#http_class_http_serverresponse) object to modify before sending the http response.\ntotalItems     | total number of items in the result set.\nmaxRangeSize   | angular-paginate-anything send is own requested range in the request, this parameter specify the maximum value.\n\n\n### Benefits\n\n* **HTTP Content-Type agnoticism.** Information about total items,\n  selected ranges, and next- previous-links are sent through headers.\n  It works without modifying your API payload in any way.\n* **Graceful degredation.** Both client and server specify the maximum\n  page size they accept and communication gracefully degrades to\n  accomodate the lesser.\n* **Expressive retrieval.** This approach, unlike the use of `per_page` and\n  `page` parameters, allows the client to request any (possibly unbounded)\n  interval of items.\n* **Semantic HTTP.** Built in strict conformance to RFCs 2616 and 5988.\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolo2ro%2Fnode-paginate-anything","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpolo2ro%2Fnode-paginate-anything","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolo2ro%2Fnode-paginate-anything/lists"}