paginate-middleware
/
0.3.0
paginate-middleware 0.3.0
Install from the command line:
Learn more about npm packages
$ npm install @untile/paginate-middleware@0.3.0
Install via package.json:
"@untile/paginate-middleware": "0.3.0"
About this version
$ yarn add @untile/paginate-middleware
Here is an example on how to use the middleware in koajs
import Koa from 'koa';
// Import the middleware.
import paginateMiddleware from '@untile/paginate-middleware';
// Create the koa app.
const app = new Koa();
// Apply the middleware.
app.use(paginateMiddleware({ maximum: 10, size: 2 }));
app.use(context => {
// { number: '1', size: '5' }
console.log(context.requestOptions.page);
});
// Start the app.
app.listen(4000);
Install the required dependencies:
yarn
And you may now run the tests with:
yarn test
Be sure to have configured GITHUB_TOKEN
in your globals.
npm version [<new version> | major | minor | patch] -m "Release %s"
git push origin master && git push --tags