{"id":21320442,"url":"https://github.com/eclass/sequelize-paginate","last_synced_at":"2025-04-04T08:04:15.900Z","repository":{"id":32397579,"uuid":"132511140","full_name":"eclass/sequelize-paginate","owner":"eclass","description":"Sequelize model plugin for add paginate method","archived":false,"fork":false,"pushed_at":"2025-03-07T16:43:15.000Z","size":1758,"stargazers_count":70,"open_issues_count":54,"forks_count":19,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T07:03:45.538Z","etag":null,"topics":["eclass","pagination","sequelize"],"latest_commit_sha":null,"homepage":null,"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/eclass.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-07T20:08:27.000Z","updated_at":"2023-08-18T13:18:00.000Z","dependencies_parsed_at":"2023-10-15T13:23:01.256Z","dependency_job_id":"3b1a0d5b-abfa-4630-bc4b-4a665d11577e","html_url":"https://github.com/eclass/sequelize-paginate","commit_stats":{"total_commits":340,"total_committers":5,"mean_commits":68.0,"dds":0.1470588235294118,"last_synced_commit":"028e120881afa9bb0b7c6f91d1690bdbba8e7806"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eclass%2Fsequelize-paginate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eclass%2Fsequelize-paginate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eclass%2Fsequelize-paginate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eclass%2Fsequelize-paginate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eclass","download_url":"https://codeload.github.com/eclass/sequelize-paginate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247139066,"owners_count":20890167,"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":["eclass","pagination","sequelize"],"created_at":"2024-11-21T19:47:50.773Z","updated_at":"2025-04-04T08:04:15.872Z","avatar_url":"https://github.com/eclass.png","language":"JavaScript","readme":"# sequelize-paginate\n\n[![npm version](https://img.shields.io/npm/v/sequelize-paginate.svg)](https://www.npmjs.com/package/sequelize-paginate)\n[![npm downloads](https://img.shields.io/npm/dm/sequelize-paginate.svg)](https://www.npmjs.com/package/sequelize-paginate)\n[![Build Status](https://travis-ci.org/eclass/sequelize-paginate.svg?branch=master)](https://travis-ci.org/eclass/sequelize-paginate)\n[![devDependency Status](https://img.shields.io/david/dev/eclass/sequelize-paginate.svg)](https://david-dm.org/eclass/sequelize-paginate#info=devDependencies)\n\n\u003e Sequelize model plugin for add paginate method\n\n## Installation\n\n```bash\nnpm i sequelize-paginate\n```\n\n## Use\n\n```js\n// model.js\nconst sequelizePaginate = require('sequelize-paginate')\n\nmodule.exports = (sequelize, DataTypes) =\u003e {\n  const MyModel = sequelize.define(\n    'MyModel',\n    {\n      name: { type: DataTypes.STRING(255) }\n    }\n  )\n  sequelizePaginate.paginate(MyModel)\n  return MyModel\n}\n\n// controller.js\nconst { Op } = db.sequelize\n// Default page = 1 and paginate = 25\nconst { docs, pages, total } = await db.MyModel.paginate()\n// Or with extra options\nconst options = {\n  attributes: ['id', 'name'],\n  page: 1, // Default 1\n  paginate: 25, // Default 25\n  order: [['name', 'DESC']],\n  where: { name: { [Op.like]: `%elliot%` } }\n}\nconst { docs, pages, total } = await db.MyModel.paginate(options)\n```\n\n**NOTE:** _If **options** include **limit** or **offset** are ignored._\n\n## License\n\n[MIT](https://tldrlegal.com/license/mit-license)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feclass%2Fsequelize-paginate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feclass%2Fsequelize-paginate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feclass%2Fsequelize-paginate/lists"}