truncated-list
Create a list of items with truncating lines to the specified maximum number
const truncatedList = ; console;
* Apple
* Orange
* Strawberry
* Grape
... and 2 more
Installation
npm install truncated-list
API
const truncatedList = ;
truncatedList(items, max)
items: Iterable<string>
(list items)
max: integer
(maximum number of items)
Return: string
It joins items into a list each of lines begins with *
.
If the number of items exceeds max
, it truncates the surplus and append ... and X more
to the result.
;//=> '* a\n* b' ;//=> '* a\n ... and 1 more'
License
ISC License © 2018 Shinnosuke Watanabe