{"name":"list-item","description":"Generate a single formatted list item, allowing you to easily generate lists with proper indentation, bullets, numbers or other leading characters.","version":"0.1.2","homepage":"https://github.com/jonschlinkert/list-item","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"https://github.com/jonschlinkert/list-item"},"bugs":{"url":"https://github.com/jonschlinkert/list-item/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"expand-range":"^1.8.1","is-number":"^1.1.0","repeat-string":"^1.5.0"},"devDependencies":{"mocha":"*","romanize":"^0.1.0","should":"*"},"keywords":["bullet","format","item","list","list-item","markdown","numbered","numerals","ordered","roman","test","unordered"],"gitHead":"153877f81c053d421f0378244b383ce2b3aa1009","_id":"list-item@0.1.2","_shasum":"4c2dbacfdc4d2e7c22adec314ce506e8d4b3dcd3","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"4c2dbacfdc4d2e7c22adec314ce506e8d4b3dcd3","tarball":"http://registry-npm.ywwl.com/list-item/download/list-item-0.1.2.tgz","integrity":"sha512-pEmnvbWbdErmhmvKYtwBnnAZ2/5QQ6dEccOzUj8cW8rNcm6h3tLUSBYEyBYBH3xGGVbw06es55ULzkRtVwqIFQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDk6jRdbcdjA7I3d8O7CVVN2R1dkLs/uey5yP5zWZn6bQIhAPF03jvZTnSmP7VbfACS1j6Xn1vYu8DxkPu2koyro87O"}],"size":3149,"noattachment":false,"key":"/list-item/-/list-item-0.1.2.tgz"},"directories":{},"readme":"# list-item [![NPM version](https://img.shields.io/npm/v/list-item.svg?style=flat)](https://www.npmjs.com/package/list-item) [![NPM monthly downloads](https://img.shields.io/npm/dm/list-item.svg?style=flat)](https://npmjs.org/package/list-item) [![NPM total downloads](https://img.shields.io/npm/dt/list-item.svg?style=flat)](https://npmjs.org/package/list-item) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/list-item.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/list-item)\n\n> Generate a single formatted list item, allowing you to easily generate lists with proper indentation, bullets, numbers or other leading characters.\n\nPlease consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save list-item\n```\n\n## Usage\n\n```js\nconst listitem = require('list-item');\n```\n\n## Examples\n\n**Basic list**\n\nGenerate a list using default bullets and indentation:\n\n```js\nconst listitem = require('list-item');\nconst li = listitem();\n\nlet list = ['a', 'b', 'c', 'd', 'e'].map((ele, i) => li(i, ele));\nconsole.log(list.join('\\n'));\n```\n\nResults in:\n\n```\n- a\n  * b\n    + c\n      - d\n        * e\n```\n\n**Roman numerals**\n\nGenerate roman numerals in increments of 10.\n\n```js\nconst listitem = require('list-item');\nconst romanize = require('romanize');\n\n// specify `chars` to pass to fill-range, and use the callback \n// to modify generated numerals\nconst li = listitem({ chars: '1..100..10' }, (indent, ch) => {\n  return indent + romanize(ch) + '.';\n});\n\n// generate a formatted list!\nlet list = ['a', 'b', 'c', 'd', 'e'].map((ele, i) => li(i, ele));\nconsole.log(list.join('\\n'));\n```\n\nResults in:\n\n```\nI. a\n  XI. b\n    XXI. c\n      XXXI. d\n        XLI. e\n```\n\n## API\n\n### [listitem](index.js#L39)\n\nReturns a function to generate a plain-text/markdown list-item, allowing options to be cached for subsequent calls.\n\n**Params**\n\n* `options` **{Object}**: pass options to customize list item characters, indentation, etc.\n* `options.nobullet` **{Boolean}**: Pass true if you only want the list iten and identation, but no bullets.\n* `options.indent` **{String}**: The amount of leading indentation to use. default is ``.\n* `options.chars` **{String|Array}**: If a string is passed, [fill-range](https://github.com/jonschlinkert/fill-range) will be used to generate an array of bullets (visit [fill-range](https://github.com/jonschlinkert/fill-range) to see all options.) Or directly pass an array of bullets, numbers, letters or other characters to use for each list item. Default `['-', '*', '+']`\n* `fn` **{Function}**: pass a function [fill-range](https://github.com/jonschlinkert/fill-range) to modify the bullet for an item as it's generated. See the [examples](#examples).\n* `returns` **{String}**: returns a formatted list item\n\n**Example**\n\n```js\nconst li = listitem(options);\n\nli(0, 'Level 0 list item');\n//=> '- Level 0 list item'\n\nli(1, 'Level 1 list item');\n//=> '  * Level 1 list item'\n\nli(2, 'Level 2 list item');\n//=> '    + Level 2 list item'\n```\n\n## Release History\n\n### 2.0.0 - July 5, 2018\n\n**Breaking changes**\n\n* The callback signature has changed to `(indent, char, level)`.\n\n## About\n\n<details>\n<summary><strong>Contributing</strong></summary>\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n</details>\n\n<details>\n<summary><strong>Running Tests</strong></summary>\n\nRunning 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:\n\n```sh\n$ npm install && npm test\n```\n\n</details>\n\n<details>\n<summary><strong>Building docs</strong></summary>\n\n_(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.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme && verb\n```\n\n</details>\n\n### Related projects\n\nYou might also be interested in these projects:\n\n* [deromanize](https://www.npmjs.com/package/deromanize): Convert roman numerals to arabic numbers (useful for books, outlines, documentation, slide decks, etc) | [homepage](https://github.com/jonschlinkert/deromanize \"Convert roman numerals to arabic numbers (useful for books, outlines, documentation, slide decks, etc)\")\n* [fill-range](https://www.npmjs.com/package/fill-range): Fill in a range of numbers or letters, optionally passing an increment or `step` to… [more](https://github.com/jonschlinkert/fill-range) | [homepage](https://github.com/jonschlinkert/fill-range \"Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex`\")\n* [randomatic](https://www.npmjs.com/package/randomatic): Generate randomized strings of a specified length using simple character sequences. The original generate-password. | [homepage](https://github.com/jonschlinkert/randomatic \"Generate randomized strings of a specified length using simple character sequences. The original generate-password.\")\n* [romanize](https://www.npmjs.com/package/romanize): Convert numbers to roman numerals (useful for books, outlines, documentation, slide decks, etc) | [homepage](https://github.com/jonschlinkert/romanize \"Convert numbers to roman numerals (useful for books, outlines, documentation, slide decks, etc)\")\n* [to-regex-range](https://www.npmjs.com/package/to-regex-range): Pass two numbers, get a regex-compatible source string for matching ranges. Validated against more than… [more](https://github.com/micromatch/to-regex-range) | [homepage](https://github.com/micromatch/to-regex-range \"Pass two numbers, get a regex-compatible source string for matching ranges. Validated against more than 2.78 million test assertions.\")\n\n### Contributors\n\n| **Commits** | **Contributor** | \n| --- | --- |\n| 18 | [jonschlinkert](https://github.com/jonschlinkert) |\n| 7 | [adjohnson916](https://github.com/adjohnson916) |\n\n### Author\n\n**Jon Schlinkert**\n\n* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)\n* [GitHub Profile](https://github.com/jonschlinkert)\n* [Twitter Profile](https://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on July 05, 2018._","publish_time":1424565436411,"_cnpm_publish_time":1424565436411,"dist-tags":{"latest":"2.0.0"}}