{"id":25431957,"url":"https://github.com/siddsarkar/paginated-response","last_synced_at":"2026-04-29T15:38:38.650Z","repository":{"id":57318155,"uuid":"301310780","full_name":"siddsarkar/paginated-response","owner":"siddsarkar","description":"Format JSON-Array to paginated form 🧾","archived":false,"fork":false,"pushed_at":"2021-01-18T07:23:23.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-20T21:40:14.698Z","etag":null,"topics":["mongodb","nodejs-express"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/paginated-response","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/siddsarkar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-05T06:15:33.000Z","updated_at":"2021-01-18T07:23:25.000Z","dependencies_parsed_at":"2022-08-25T22:41:20.029Z","dependency_job_id":null,"html_url":"https://github.com/siddsarkar/paginated-response","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/siddsarkar/paginated-response","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siddsarkar%2Fpaginated-response","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siddsarkar%2Fpaginated-response/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siddsarkar%2Fpaginated-response/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siddsarkar%2Fpaginated-response/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/siddsarkar","download_url":"https://codeload.github.com/siddsarkar/paginated-response/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siddsarkar%2Fpaginated-response/sbom","scorecard":{"id":822422,"data":{"date":"2025-08-11","repo":{"name":"github.com/siddsarkar/paginated-response","commit":"b60c08af2dd903f40c849c11bacaa447340c9208"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/npm-publish.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/13 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npm-publish.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/siddsarkar/paginated-response/npm-publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npm-publish.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/siddsarkar/paginated-response/npm-publish.yml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/npm-publish.yml:20","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}}]},"last_synced_at":"2025-08-23T15:55:15.720Z","repository_id":57318155,"created_at":"2025-08-23T15:55:15.720Z","updated_at":"2025-08-23T15:55:15.720Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32432570,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T13:34:34.882Z","status":"ssl_error","status_checked_at":"2026-04-29T13:34:29.830Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["mongodb","nodejs-express"],"created_at":"2025-02-17T04:31:05.144Z","updated_at":"2026-04-29T15:38:38.636Z","avatar_url":"https://github.com/siddsarkar.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## About the package\n\nThis package format JSON-Array data to paginated form to send to client for front-end display.\n\n## Installation\n\nRun `npm i paginated-response`\n\n## Test\n\n```js\nconst paginatedResponse = require(\"paginated-response\");\n\nconst jsonArray = [\n  {\n    _id: \"5f78e2112cc17f206c131125\",\n    title: \"bg\",\n  },\n  {\n    _id: \"5f78e8cc3b076d0017b4e634\",\n    title: \"Tags featured 🥳🥳\",\n  },\n  {\n    _id: \"5f79af1466ac4d256899249e\",\n    title: \"ad\",\n  },\n  {\n    _id: \"5f79c6b107e3fa00176c4ba4\",\n    title: \"Gg again\",\n  },\n  {\n    _id: \"5f79c6d607e3fa00176c4ba5\",\n    title: \"Wow\",\n  },\n];\n\nlet paginated = paginatedResponse(jsonArray, 3, 2);\n\nconsole.log(paginated);\n\n// OUTPUT:\n// {\n//   page: 3,\n//   pageCount: 3,\n//   posts: [\n//     {\n//       _id: '5f79c6d607e3fa00176c4ba5',\n//       title: 'Wow'\n//     }\n//   ]\n// }\n```\n\n## Parameters\n\nThis package requires three parameters.\n\n`jsonArray` -\u003e 1st parameter - Main data\n\n`pageno` -\u003e 2nd parameter - Page no. to fetch\n\n`perPage` -\u003e 3rd parameter - no of data to send in a page, optional default is 10\n\n## Example Usage\n\n```js\nconst paginatedResponse = require(\"paginated-response\");\n\nconst jsonArray = [\n  {\n    _id: \"5f78e2112cc17f206c131125\",\n    title: \"bg\",\n  },\n  {\n    _id: \"5f78e8cc3b076d0017b4e634\",\n    title: \"Tags featured 🥳🥳\",\n  },\n  {\n    _id: \"5f79af1466ac4d256899249e\",\n    title: \"ad\",\n  },\n  {\n    _id: \"5f79c6b107e3fa00176c4ba4\",\n    title: \"Gg again\",\n  },\n  {\n    _id: \"5f79c6d607e3fa00176c4ba5\",\n    title: \"Wow\",\n  },\n];\n\napp.get(\"/api/posts\", (req, res) =\u003e {\n  const page = req.query.p; //page number requested\n  const perPage = 2; //optional, default is 10\n  let paginated = paginatedResponse(jsonArray, page, perPage);\n  res.json(paginated);\n  //see output below\n});\n```\n\nExample Request:\n\n```js\nfetch(\"/api/posts?p=3\"); //request page no. 3 of posts\n```\n\nExample Response\n\n```js\n{\n  \"page\": 3,  //got page number\n  \"pageCount\": 3,  //total pages\n  \"posts\":[   //data of page 3\n    {\n      _id: \"5f79c6d607e3fa00176c4ba5\",\n      title: \"Wow\",\n    },\n  ]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiddsarkar%2Fpaginated-response","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsiddsarkar%2Fpaginated-response","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiddsarkar%2Fpaginated-response/lists"}