egg-pagination
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

egg-pagination

NPM version Test coverage Known Vulnerabilities

Parse pagination data from query parameters.

Install

$ npm i egg-pagination --save

Usage

// {app_root}/config/plugin.js
exports.pagination = {
  enable: true,
  package: 'egg-pagination',
};

Configuration

// {app_root}/config/config.default.js
exports.pagination = {
  pageSize: 10,
  maxPageSize: 50,
};

Example

  const pagination = this.ctx.request.pagination();
  const { page, pageSize, offset } = pagination;

Questions & Suggestions

Please open an issue here.

License

MIT

Dependencies (0)

    Dev Dependencies (8)

    Package Sidebar

    Install

    npm i egg-pagination

    Weekly Downloads

    16

    Version

    0.1.1

    License

    MIT

    Unpacked Size

    5.77 kB

    Total Files

    9

    Last publish

    Collaborators

    • k.cai