{"_id":"paginationator","_rev":"231713","name":"paginationator","description":"Paginate an array into pages of items.","dist-tags":{"latest":"0.1.4"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"time":{"modified":"2021-06-03T15:46:37.000Z","created":"2015-09-10T04:15:32.610Z","0.1.4":"2016-07-19T09:18:09.506Z","0.1.3":"2015-12-20T11:49:32.650Z","0.1.2":"2015-09-10T04:50:08.950Z","0.1.1":"2015-09-10T04:25:58.745Z","0.1.0":"2015-09-10T04:15:32.610Z"},"users":{},"author":{"name":"Brian Woodward","url":"https://github.com/doowb"},"repository":{"type":"git","url":"git+https://github.com/doowb/paginationator.git"},"versions":{"0.1.4":{"name":"paginationator","description":"Paginate an array into pages of items.","version":"0.1.4","homepage":"https://github.com/doowb/paginationator","author":{"name":"Brian Woodward","url":"https://github.com/doowb"},"repository":{"type":"git","url":"git+https://github.com/doowb/paginationator.git"},"bugs":{"url":"https://github.com/doowb/paginationator/issues"},"license":"MIT","files":["index.js","lib","LICENSE","README.md"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"devDependencies":{"gulp-format-md":"^0.1.9","mocha":"^2.5.3"},"keywords":["paginationator"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"related":{"list":["assemble","templates","verb"]},"lint":{"reflinks":true},"reflinks":["verb","verb-generate-readme"]},"gitHead":"169283956a39aa6478ceecc52a40870eb861c1ca","_id":"paginationator@0.1.4","_shasum":"84786dd3850aae1f11bbb911b0c1e0851b538106","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"84786dd3850aae1f11bbb911b0c1e0851b538106","size":4251,"noattachment":false,"key":"/paginationator/-/paginationator-0.1.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/paginationator/download/paginationator-0.1.4.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/paginationator-0.1.4.tgz_1468919888433_0.09646083484403789"},"directories":{},"publish_time":1468919889506,"_cnpm_publish_time":1468919889506,"_hasShrinkwrap":false},"0.1.3":{"name":"paginationator","description":"Paginate an array into pages of items.","version":"0.1.3","homepage":"https://github.com/doowb/paginationator","author":{"name":"Brian Woodward","url":"https://github.com/doowb"},"repository":{"type":"git","url":"git+https://github.com/doowb/paginationator.git"},"bugs":{"url":"https://github.com/doowb/paginationator/issues"},"license":"MIT","files":["index.js","lib/"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"define-property":"^0.2.5"},"devDependencies":{"mocha":"*","should":"*"},"verb":{"related":{"list":["assemble","base-methods","templates","verb"]},"plugins":["gulp-format-md"]},"gitHead":"8fae60a7c9891cbde5475c08cb6d274cbdb2ee9c","_id":"paginationator@0.1.3","_shasum":"0e05dfdac1f7e932522dc87df0083a800844e277","_from":".","_npmVersion":"3.3.6","_nodeVersion":"5.0.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"0e05dfdac1f7e932522dc87df0083a800844e277","size":3817,"noattachment":false,"key":"/paginationator/-/paginationator-0.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/paginationator/download/paginationator-0.1.3.tgz"},"directories":{},"publish_time":1450612172650,"_cnpm_publish_time":1450612172650,"_hasShrinkwrap":false},"0.1.2":{"name":"paginationator","description":"Paginate an array into pages of items.","version":"0.1.2","homepage":"https://github.com/doowb/paginationator","author":{"name":"Brian Woodward","url":"https://github.com/doowb"},"repository":{"type":"git","url":"git+https://github.com/doowb/paginationator.git"},"bugs":{"url":"https://github.com/doowb/paginationator/issues"},"license":"MIT","files":["lib/","index.js"],"main":"index.js","browser":{"./lib/utils.js":"./lib/utils-browser.js"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"devDependencies":{"mocha":"*","should":"^7.1.0"},"dependencies":{"base-methods":"^0.2.3","define-property":"^0.2.5","lazy-cache":"^0.2.3"},"verb":{"related":{"list":["template","templates","assemble","verb"]}},"gitHead":"7c1fc7f8dec765ad2ab5e0aa6ec59955c36b7e81","_id":"paginationator@0.1.2","_shasum":"156adf7eddd8988ee8942a9acbff5a7e25173d7d","_from":".","_npmVersion":"2.13.3","_nodeVersion":"0.12.0","_npmUser":{"name":"doowb","email":"brian.woodward@gmail.com"},"dist":{"shasum":"156adf7eddd8988ee8942a9acbff5a7e25173d7d","size":3953,"noattachment":false,"key":"/paginationator/-/paginationator-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/paginationator/download/paginationator-0.1.2.tgz"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"directories":{},"publish_time":1441860608950,"_cnpm_publish_time":1441860608950,"_hasShrinkwrap":false},"0.1.1":{"name":"paginationator","description":"Paginate an array into pages of items.","version":"0.1.1","homepage":"https://github.com/doowb/paginationator","author":{"name":"Brian Woodward","url":"https://github.com/doowb"},"repository":{"type":"git","url":"git+https://github.com/doowb/paginationator.git"},"bugs":{"url":"https://github.com/doowb/paginationator/issues"},"license":"MIT","files":["lib/","index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"devDependencies":{"mocha":"*","should":"^7.1.0"},"dependencies":{"base-methods":"^0.2.3","define-property":"^0.2.5","lazy-cache":"^0.2.3"},"verb":{"related":{"list":["template","templates","assemble","verb"]}},"gitHead":"c449587e5a5e8cd52ace7b5d35e187bf72352c5d","_id":"paginationator@0.1.1","_shasum":"6047da68fdec8e6918da9488f184d620e74ea992","_from":".","_npmVersion":"2.13.3","_nodeVersion":"0.12.0","_npmUser":{"name":"doowb","email":"brian.woodward@gmail.com"},"dist":{"shasum":"6047da68fdec8e6918da9488f184d620e74ea992","size":3875,"noattachment":false,"key":"/paginationator/-/paginationator-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/paginationator/download/paginationator-0.1.1.tgz"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"directories":{},"publish_time":1441859158745,"_cnpm_publish_time":1441859158745,"_hasShrinkwrap":false},"0.1.0":{"name":"paginationator","description":"Paginate an array into pages of items.","version":"0.1.0","homepage":"https://github.com/doowb/paginationator","author":{"name":"Brian Woodward","url":"https://github.com/doowb"},"repository":{"type":"git","url":"git+https://github.com/doowb/paginationator.git"},"bugs":{"url":"https://github.com/doowb/paginationator/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"devDependencies":{"mocha":"*","should":"^7.1.0"},"dependencies":{"base-methods":"^0.2.3","define-property":"^0.2.5","lazy-cache":"^0.2.3"},"verb":{"related":{"list":["template","templates","assemble","verb"]}},"gitHead":"1398cb81d6a5d12374c74b0db3d2518a6ed37423","_id":"paginationator@0.1.0","_shasum":"c2ab6f8ae9ab764805e92b7805d972ebb9699015","_from":".","_npmVersion":"2.13.3","_nodeVersion":"0.12.0","_npmUser":{"name":"doowb","email":"brian.woodward@gmail.com"},"dist":{"shasum":"c2ab6f8ae9ab764805e92b7805d972ebb9699015","size":2884,"noattachment":false,"key":"/paginationator/-/paginationator-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/paginationator/download/paginationator-0.1.0.tgz"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"directories":{},"publish_time":1441858532610,"_cnpm_publish_time":1441858532610,"_hasShrinkwrap":false}},"readme":"# paginationator [![NPM version](https://img.shields.io/npm/v/paginationator.svg?style=flat)](https://www.npmjs.com/package/paginationator) [![NPM downloads](https://img.shields.io/npm/dm/paginationator.svg?style=flat)](https://npmjs.org/package/paginationator) [![Build Status](https://img.shields.io/travis/doowb/paginationator.svg?style=flat)](https://travis-ci.org/doowb/paginationator)\n\nPaginate an array into pages of items.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save paginationator\n```\n\n![image](https://cloud.githubusercontent.com/assets/995160/9802527/ca15f300-57e8-11e5-96db-523ea5a0572e.png)\n\n## Usage\n\n```js\nvar paginationator = require('paginationator');\n```\n\n## API\n\n### [paginationator](index.js#L34)\n\nPaginate an array with given options and return a `Page` object containing an array of `pages` with pagination information.\n\n**Params**\n\n* `arr` **{Array}**: Array of items to paginate\n* `options` **{Object}**: Additional options to control pagination\n* `options.limit` **{Number}**: Number of items per page (defaults to 10)\n* `returns` **{Object}**: paginated pages\n\n**Example**\n\n```js\nvar pages = paginationator([1, 2, 3, 4, 5], {limit: 2});\n//=> { pages: [\n//=>   { idx: 0, total: 3, current: 1, items: [1, 2], first: 1, last: 3, next: 2 },\n//=>   { idx: 1, total: 3, current: 2, items: [3, 4], first: 1, last: 3, prev: 1, next: 3 },\n//=>   { idx: 2, total: 3, current: 3, items: [5], first: 1, last: 3, prev: 2 }\n//=> ]}\n```\n\n### [Page](lib/page.js#L14)\n\nPage constructor\n\n**Params**\n\n* `page` **{Object}**: optional page object to populate initial values.\n\n**Example**\n\n```js\nvar page = new Page();\n```\n\n### [Pages](lib/pages.js#L16)\n\nPages constructor\n\n**Params**\n\n* `pages` **{Array}**: Optional array of pages to initialize the `pages` array.\n\n**Example**\n\n```js\nvar pages = new Pages();\n```\n\n### [.addPage](lib/pages.js#L37)\n\nAdd a page to the list.\n\n**Params**\n\n* `page` **{Object}**: Plain object or instance of a `Page`\n* `returns` **{Object}**: Returns the instance for chaining\n\n**Example**\n\n```js\npages.addPage({items: [1, 2, 3]});\n```\n\n### [.addPages](lib/pages.js#L55)\n\nAdd an array of pages to the list.\n\n**Params**\n\n* `pages` **{Object}**: Array of page objects\n* `returns` **{Object}**: Returns the instance for chaining\n\n**Example**\n\n```js\npages.addPages([...]);\n```\n\n## About\n\n### Related projects\n\n* [assemble](https://www.npmjs.com/package/assemble): Get the rocks out of your socks! Assemble makes you fast at creating web projects… [more](https://github.com/assemble/assemble) | [homepage](https://github.com/assemble/assemble \"Get the rocks out of your socks! Assemble makes you fast at creating web projects. Assemble is used by thousands of projects for rapid prototyping, creating themes, scaffolds, boilerplates, e-books, UI components, API documentation, blogs, building websit\")\n* [templates](https://www.npmjs.com/package/templates): System for creating and managing template collections, and rendering templates with any node.js template engine… [more](https://github.com/jonschlinkert/templates) | [homepage](https://github.com/jonschlinkert/templates \"System for creating and managing template collections, and rendering templates with any node.js template engine. Can be used as the basis for creating a static site generator or blog framework.\")\n* [verb](https://www.npmjs.com/package/verb): Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used… [more](https://github.com/verbose/verb) | [homepage](https://github.com/verbose/verb \"Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used on hundreds of projects of all sizes to generate everything from API docs to readmes.\")\n\n### Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n### Building docs\n\n_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_\n\nTo generate the readme and API documentation with [verb](https://github.com/verbose/verb):\n\n```sh\n$ npm install -g verb verb-generate-readme && verb\n```\n\n### Running tests\n\nInstall dev dependencies:\n\n```sh\n$ npm install -d && npm test\n```\n\n### Author\n\n**Brian Woodward**\n\n* [github/doowb](https://github.com/doowb)\n* [twitter/doowb](http://twitter.com/doowb)\n\n### License\n\nCopyright © 2016, [Brian Woodward](https://github.com/doowb).\nReleased under the [MIT license](https://github.com/doowb/paginationator/blob/master/LICENSE).\n\n***\n\n_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on July 19, 2016._","_attachments":{},"homepage":"https://github.com/doowb/paginationator","bugs":{"url":"https://github.com/doowb/paginationator/issues"},"license":"MIT"}