UNPKG

terminal-paginator

Version:

Paginator used for rendering lists or choices for prompts in the terminal.

70 lines (43 loc) 3.29 kB
# terminal-paginator [![NPM version](https://img.shields.io/npm/v/terminal-paginator.svg?style=flat)](https://www.npmjs.com/package/terminal-paginator) [![NPM monthly downloads](https://img.shields.io/npm/dm/terminal-paginator.svg?style=flat)](https://npmjs.org/package/terminal-paginator) [![NPM total downloads](https://img.shields.io/npm/dt/terminal-paginator.svg?style=flat)](https://npmjs.org/package/terminal-paginator) > Paginator used for rendering lists or choices for prompts in the terminal. ## Install Install with [npm](https://www.npmjs.com/): ```sh $ npm install --save terminal-paginator ``` ## Usage ```js var Paginator = require('terminal-paginator'); var paginator = new Paginator(); paginator.paginate(string, selectedIndex, pageLimit); ``` ## Attribution Based on the Paginator in Inquirer. ## About ### Related projects * [choices-separator](https://www.npmjs.com/package/choices-separator): Separator for choices arrays in prompts. Based on the Separator from inquirer. | [homepage](https://github.com/enquirer/choices-separator "Separator for choices arrays in prompts. Based on the Separator from inquirer.") * [enquirer](https://www.npmjs.com/package/enquirer): Intuitive, plugin-based prompt system for node.js. Much faster and lighter alternative to Inquirer, with all… [more](https://github.com/enquirer/enquirer) | [homepage](https://github.com/enquirer/enquirer "Intuitive, plugin-based prompt system for node.js. Much faster and lighter alternative to Inquirer, with all the same prompt types and more, but without the bloat.") * [prompt-choices](https://www.npmjs.com/package/prompt-choices): Create an array of multiple choice objects for use in prompts. | [homepage](https://github.com/enquirer/prompt-choices "Create an array of multiple choice objects for use in prompts.") * [readline-utils](https://www.npmjs.com/package/readline-utils): Readline utils, for moving the cursor, clearing lines, creating a readline interface, and more. | [homepage](https://github.com/enquirer/readline-utils "Readline utils, for moving the cursor, clearing lines, creating a readline interface, and more.") ### Contributing Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). ### Building docs _(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ To generate the readme, run the following command: ```sh $ npm install -g verbose/verb#dev verb-generate-readme && verb ``` ### Running tests Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: ```sh $ npm install && npm test ``` ### Author **Jon Schlinkert** * [github/jonschlinkert](https://github.com/jonschlinkert) * [twitter/jonschlinkert](https://twitter.com/jonschlinkert) ### License Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). Released under the [MIT License](LICENSE). *** _This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 24, 2017._