{"_id":"@abhihyder/js-paginator","_rev":"3-6193d58c93636a20585ef01aef617f16","name":"@abhihyder/js-paginator","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@abhihyder/js-paginator","version":"1.0.0","keywords":["pagination","paginator","paginate","js","javascript","utility"],"author":{"name":"Tofayel Hyder Abhi","email":"tofayelhyder71@gmail.com"},"license":"MIT","_id":"@abhihyder/js-paginator@1.0.0","maintainers":[{"name":"tofayelhyder","email":"abhihyder7@gmail.com"}],"homepage":"https://github.com/abhihyder/js-paginator#readme","bugs":{"url":"https://github.com/abhihyder/js-paginator/issues"},"dist":{"shasum":"6e271100b47726605248bb577847304cdc2f00b2","tarball":"https://registry.npmjs.org/@abhihyder/js-paginator/-/js-paginator-1.0.0.tgz","fileCount":5,"integrity":"sha512-zl1iRM5mpzLZsvvG9CzyVShT5S1bNiu/3d7m+oCNF+EsewvBmmr2fzuXgfXgiSzc0txpvaP00lxy0O5Gp6/47g==","signatures":[{"sig":"MEUCIQDAlV8YXPYEnHrA9ziwfxkq59/Duh8QdicQej5Xn9TwMwIgIR2nRNtLLMp44h59/+qg1hAT0Xqrwl9oCFL0AwRm7wg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11068},"main":"index.js","gitHead":"74379b5a2f4f31b074e7fc4d4757e76a930622a6","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"tofayelhyder","email":"abhihyder7@gmail.com"},"repository":{"url":"git+https://github.com/abhihyder/js-paginator.git","type":"git"},"_npmVersion":"10.5.0","description":"A versatile JavaScript pagination utility for simplifying pagination implementation in JavaScript applications. Supports customizable pagination links, first and last page navigation, and easy integration with various JavaScript frameworks.","directories":{},"_nodeVersion":"20.12.2","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/js-paginator_1.0.0_1717948187302_0.601728187364758","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@abhihyder/js-paginator","version":"1.0.1","keywords":["pagination","paginator","paginate","js","javascript","utility"],"author":{"name":"Tofayel Hyder Abhi","email":"tofayelhyder71@gmail.com"},"license":"MIT","_id":"@abhihyder/js-paginator@1.0.1","maintainers":[{"name":"tofayelhyder","email":"abhihyder7@gmail.com"}],"homepage":"https://github.com/abhihyder/js-paginator#readme","bugs":{"url":"https://github.com/abhihyder/js-paginator/issues"},"dist":{"shasum":"3e988d8afbbdc491bb4b252beb98818d9e782f1e","tarball":"https://registry.npmjs.org/@abhihyder/js-paginator/-/js-paginator-1.0.1.tgz","fileCount":7,"integrity":"sha512-GCMZp1KShV8qGpyMjb8H91PVJdc7j7uEx67r9ljn5sLAbjFeSpRdKLp1Z8BoChR2dWaVF1fqdPQynyGMSuPl9A==","signatures":[{"sig":"MEUCICZwHUgXhk6mPN6tkQb9pGJhH9tl8dD81nqvv0+o9qcFAiEA4jDNhZkBa8XGHi5E7CDh5sg+4FyAcemD+VRT8hMUltU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11645},"main":"index.cjs","types":"index.d.ts","module":"index.mjs","exports":{"import":"./index.mjs","require":"./index.cjs"},"gitHead":"682b6d999f724828af1829f84f128a32675bb2c8","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"tofayelhyder","email":"abhihyder7@gmail.com"},"repository":{"url":"git+https://github.com/abhihyder/js-paginator.git","type":"git"},"_npmVersion":"10.9.0","description":"A versatile JavaScript pagination utility for simplifying pagination implementation in JavaScript applications. Supports customizable pagination links, first and last page navigation, and easy integration with various JavaScript frameworks.","directories":{},"_nodeVersion":"22.12.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/js-paginator_1.0.1_1739117220142_0.6205171141554087","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@abhihyder/js-paginator","version":"1.0.2","keywords":["pagination","paginator","paginate","js","javascript","utility"],"author":{"name":"Tofayel Hyder Abhi","email":"tofayelhyder71@gmail.com"},"license":"MIT","_id":"@abhihyder/js-paginator@1.0.2","maintainers":[{"name":"tofayelhyder","email":"abhihyder7@gmail.com"}],"homepage":"https://github.com/abhihyder/js-paginator#readme","bugs":{"url":"https://github.com/abhihyder/js-paginator/issues"},"dist":{"shasum":"3f5eb51e370cc2857fc73831872df605aa85961c","tarball":"https://registry.npmjs.org/@abhihyder/js-paginator/-/js-paginator-1.0.2.tgz","fileCount":7,"integrity":"sha512-yO+X3cZOVpqcX7iUEmSqyTSsHeFmS9YY9up0+BTqU9XsHRfVQ5iZWa7qsust8IxZEh/4kIF32pOM3abKwJ49bQ==","signatures":[{"sig":"MEUCIHSjtE/t6gq7h5r5TIRXwsdz1TjEDmsXOaQfIQpCJ2PNAiEA9yHU2gfwKBD+Q5VJxKoX20WcR8vfzOcHNuhBjNAH9is=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11559},"main":"src/index.cjs","types":"src/index.d.ts","module":"src/index.mjs","exports":{"import":"./src/index.mjs","require":"./src/index.cjs"},"gitHead":"682b6d999f724828af1829f84f128a32675bb2c8","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc"},"_npmUser":{"name":"tofayelhyder","email":"abhihyder7@gmail.com"},"repository":{"url":"git+https://github.com/abhihyder/js-paginator.git","type":"git"},"_npmVersion":"10.8.2","description":"A versatile JavaScript pagination utility for simplifying pagination implementation in JavaScript applications.","directories":{},"_nodeVersion":"20.18.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/js-paginator_1.0.2_1739118793077_0.40966247972271974","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@abhihyder/js-paginator","version":"1.0.3","description":"A versatile JavaScript pagination utility for simplifying pagination implementation in JavaScript applications.","main":"src/index.cjs","module":"src/index.mjs","types":"src/index.d.ts","exports":{"import":"./src/index.mjs","require":"./src/index.cjs","types":"./src/index.d.ts"},"scripts":{"build":"tsc","test":"echo \"Error: no test specified\" && exit 1"},"keywords":["pagination","paginator","paginate","js","javascript","utility"],"author":{"name":"Tofayel Hyder Abhi","email":"tofayelhyder71@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/abhihyder/js-paginator.git"},"license":"MIT","_id":"@abhihyder/js-paginator@1.0.3","gitHead":"940097de1bb294ba165c47215827c3dcc5787d68","bugs":{"url":"https://github.com/abhihyder/js-paginator/issues"},"homepage":"https://github.com/abhihyder/js-paginator#readme","_nodeVersion":"22.12.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-LxABZEWsMh6BLB829c/OwbstQMC6GgEROp+asqAhtN4NS5rVREFu7mSk53FaCXTLgufY00U0r68B1vERbteu6g==","shasum":"cac8aa68e96325648ed2a2b7a6adfd4c5fe0424c","tarball":"https://registry.npmjs.org/@abhihyder/js-paginator/-/js-paginator-1.0.3.tgz","fileCount":7,"unpackedSize":11590,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFYmzDk7YR5SP/R4fZrQx5nunNoqSLi003BxVVXIj6rLAiEAmx34TULe9Teyb9EFac40xax/GaodFjv84uyDTVqm2CE="}]},"_npmUser":{"name":"tofayelhyder","email":"abhihyder7@gmail.com"},"directories":{},"maintainers":[{"name":"tofayelhyder","email":"abhihyder7@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/js-paginator_1.0.3_1739198720378_0.4744144606422591"},"_hasShrinkwrap":false}},"time":{"created":"2024-06-09T15:49:47.179Z","modified":"2025-02-10T14:45:20.782Z","1.0.0":"2024-06-09T15:49:47.455Z","1.0.1":"2025-02-09T16:07:00.298Z","1.0.2":"2025-02-09T16:33:13.244Z","1.0.3":"2025-02-10T14:45:20.573Z"},"bugs":{"url":"https://github.com/abhihyder/js-paginator/issues"},"author":{"name":"Tofayel Hyder Abhi","email":"tofayelhyder71@gmail.com"},"license":"MIT","homepage":"https://github.com/abhihyder/js-paginator#readme","keywords":["pagination","paginator","paginate","js","javascript","utility"],"repository":{"type":"git","url":"git+https://github.com/abhihyder/js-paginator.git"},"description":"A versatile JavaScript pagination utility for simplifying pagination implementation in JavaScript applications.","maintainers":[{"name":"tofayelhyder","email":"abhihyder7@gmail.com"}],"readme":"# JS Paginator\n\n**js-paginator** is a lightweight utility for simplifying pagination in JavaScript applications. Whether you're working with APIs or databases, `js-paginator` provides a straightforward way to generate pagination links and manage pagination logic.\n\n## Features\n\n- **Easy Integration:** Integrate pagination functionality seamlessly into your JavaScript applications with minimal setup.\n- **Flexible Configuration:** Customize pagination settings to fit your specific use case, including specifying the current page, limit per page, total number of items, and base URL.\n- **Advanced Pagination:** Supports both simple and complex pagination scenarios, including scenarios with large datasets and custom query parameters.\n- **Concise and Readable:** Generates clear and concise pagination links, making it easy for users to navigate through paginated content.\n- **Lightweight:** Designed to be lightweight and performant, ensuring minimal impact on application performance.\n\n## Installation\n\nYou can install **js-paginator** via npm. Navigate to your project directory and run:\n\n```bash\nnpm i @abhihyder/js-paginator\n```\n\n## Usage\n\n### Basic Usage\n\n```javascript\nconst paginator = require(\"@abhihyder/js-paginator\");\n// Or\nimport paginator from \"@abhihyder/js-paginator\";\n\n// Get pagination data\nconst pagination = paginator({\n  currentPage: 10,\n  limit: 10,\n  totalItem: 200,\n  baseUrl: \"https://example.com/api/items\",\n});\n\nconsole.log(pagination);\n```\n\n#### Response\n\n```json\n{\n  \"currentPage\": 10,\n  \"totalPages\": 20,\n  \"from\": 91,\n  \"to\": 100,\n  \"totalItem\": 200,\n  \"links\": {\n    \"first\": \"https://example.com/api/items?page=1&limit=10\",\n    \"last\": \"https://example.com/api/items?page=20&limit=10\",\n    \"prev\": \"https://example.com/api/items?page=9&limit=10\",\n    \"next\": \"https://example.com/api/items?page=11&limit=10\"\n  },\n  \"pagination\": [\n    {\n      \"page\": 1,\n      \"url\": \"https://example.com/api/items?page=1&limit=10\"\n    },\n    {\n      \"page\": 2,\n      \"url\": \"https://example.com/api/items?page=2&limit=10\"\n    },\n    {\n      \"page\": \"...\",\n      \"url\": null\n    },\n    {\n      \"page\": 9,\n      \"url\": \"https://example.com/api/items?page=9&limit=10\"\n    },\n    {\n      \"page\": 10,\n      \"url\": \"https://example.com/api/items?page=10&limit=10\"\n    },\n    {\n      \"page\": 11,\n      \"url\": \"https://example.com/api/items?page=11&limit=10\"\n    },\n    {\n      \"page\": \"...\",\n      \"url\": null\n    },\n    {\n      \"page\": 19,\n      \"url\": \"https://example.com/api/items?page=19&limit=10\"\n    },\n    {\n      \"page\": 20,\n      \"url\": \"https://example.com/api/items?page=20&limit=10\"\n    }\n  ]\n}\n```\n\n### Advanced Usage\n\n```javascript\n// Specify custom query parameters\nconst queryString = {\n  name: \"javascript\",\n  category: \"books\",\n};\n\n// Pass custom query parameters\nconst pagination = paginator(\n  {\n    currentPage: 10,\n    limit: 10,\n    totalItem: 200,\n    baseUrl: \"https://example.com/api/items\",\n  },\n  queryString\n);\n\nconsole.log(pagination);\n```\n\n#### Response\n\n```json\n{\n  \"currentPage\": 10,\n  \"totalPages\": 20,\n  \"from\": 91,\n  \"to\": 100,\n  \"totalItem\": 200,\n  \"links\": {\n    \"first\": \"https://example.com/api/items?page=1&limit=10&name=javascript&category=books\",\n    \"last\": \"https://example.com/api/items?page=20&limit=10&name=javascript&category=books\",\n    \"prev\": \"https://example.com/api/items?page=9&limit=10&name=javascript&category=books\",\n    \"next\": \"https://example.com/api/items?page=11&limit=10&name=javascript&category=books\"\n  },\n  \"pagination\": [\n    {\n      \"page\": 1,\n      \"url\": \"https://example.com/api/items?page=1&limit=10&name=javascript&category=books\"\n    },\n    {\n      \"page\": 2,\n      \"url\": \"https://example.com/api/items?page=2&limit=10&name=javascript&category=books\"\n    },\n    {\n      \"page\": \"...\",\n      \"url\": null\n    },\n    {\n      \"page\": 9,\n      \"url\": \"https://example.com/api/items?page=9&limit=10&name=javascript&category=books\"\n    },\n    {\n      \"page\": 10,\n      \"url\": \"https://example.com/api/items?page=10&limit=10&name=javascript&category=books\"\n    },\n    {\n      \"page\": 11,\n      \"url\": \"https://example.com/api/items?page=11&limit=10&name=javascript&category=books\"\n    },\n    {\n      \"page\": \"...\",\n      \"url\": null\n    },\n    {\n      \"page\": 19,\n      \"url\": \"https://example.com/api/items?page=19&limit=10&name=javascript&category=books\"\n    },\n    {\n      \"page\": 20,\n      \"url\": \"https://example.com/api/items?page=20&limit=10&name=javascript&category=books\"\n    }\n  ]\n}\n```\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).","readmeFilename":"README.md"}