Nightly Perpetrated Mischief

    @wdalmut/knex-paginator

    0.0.1 • Public • Published

    Paginator for Knex

    Add paginator to knex

    const knex = require('knex')(require('../knexfile').test)
    const paginator = require('@wdalmut/knex-paginator')
    paginator(knex)
    

    Use paginator as latest element of a query

    knex('test')
        .where('something', '=', 'test')
        .paginate({ limit: 5, page: 1 })
        .then(results => {
            /**
             * { totalCount, lastPage, limit, page, offset, to, results }
             */
        })
    

    Create test database

    npm run db:create
    

    Migration

    npm run db:migrate
    

    Run test cases

    npm test
    

    Knex extends

    Here the base docs: https://github.com/tgriesser/knex/issues/1158

    Keywords

    none

    Install

    npm i @wdalmut/knex-paginator

    DownloadsWeekly Downloads

    2

    Version

    0.0.1

    License

    MIT

    Unpacked Size

    7.61 kB

    Total Files

    10

    Last publish

    Collaborators

    • wdalmut