{"name":"wordwrapjs","author":{"name":"Lloyd Brookes","email":"75pound@gmail.com"},"version":"5.0.2","description":"Word-wrapping for javascript.","repository":{"type":"git","url":"git+https://github.com/75lb/wordwrapjs.git"},"license":"MIT","main":"index.mjs","keywords":["word","line","wrap","text","columns","wordwrap"],"engines":{"node":">=14"},"scripts":{"test":"npm run dist && test-runner test.mjs","docs":"jsdoc2md -c jsdoc.conf -t README.hbs index.mjs > README.md; echo","dist":"rollup -c"},"devDependencies":{"jsdoc-to-markdown":"^7.0.1","rollup":"^2.44.0","rollup-plugin-node-resolve":"^5.2.0","test-runner":"~0.8.14"},"dependencies":{"reduce-flatten":"^3.0.0","typical":"^6.0.1"},"gitHead":"48c3c32208c35e78dbf70a989a5a2aab69bac2ed","bugs":{"url":"https://github.com/75lb/wordwrapjs/issues"},"homepage":"https://github.com/75lb/wordwrapjs#readme","_id":"wordwrapjs@5.0.2","_nodeVersion":"15.12.0","_npmVersion":"7.6.3","dist":{"integrity":"sha512-dPNYZzMWCXdBewUAFEkblEqEuFzs3JgK9VmNqceJ2IFOkn0sbMVsjJ4l55dZD6Ddolb9V1xlbVER2q3WN8RUWg==","shasum":"4454587ec2bbbe9f7de138ebe23eaa21450d8593","tarball":"http://registry-npm.ywwl.com/wordwrapjs/download/wordwrapjs-5.0.2.tgz","fileCount":7,"unpackedSize":35048,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgYhnMCRA9TVsSAnZWagAAHWkP/Am+K20HSOPew5jPh5w3\nPhG4AHN4wjGafCZjbhrDociRhPcdpdLWmqIebi9HuqgV4b7oo6N8oGLZVKh+\nKNJDQy1h2TlWTrXBxEdTxRPa8yfQ9TCFld0UCI92BZe+DRlR452ndonFf6R8\nMJ/fQCIWfg/sq+sArdujvTJSJAzOJV4qaSMI19VTIZu1tbTFuQ11mR69H7lo\nuKm9pVyylnLsovM8K4H5G3pFTO9hqfeSBjVTypMuyouXkiDgwflV2uqVIvcS\n2MDJBXsw38C5/pGcV0hfddfUKA5k+wf5EcfRKEfx5g37GmF48Qog3Rw6kRni\nO5Y6SfzX5u+WIzJ6JQd6ELmi0ahrpYBj4BwP9019+ILSgT9Ow5DOtXiIRJ5Q\noEqgDzEPkBIlzo8ahn3IOcJ58oHSUgdv9Ash1yMS+eA65FWSpnm3fDQQt0qQ\nHDay2cdWxsRhDpjv0roJGARgjAQsCp0gRj/qeS4VcV8t4UN7RZcCZ3eGHNOb\nb42kpvYew3M0DXTfpbtfHuDbuhBkhUVCKiNh0yNn5AiPPckAgdDF9QLX3HTR\n6D/A9Uq8Dl3grosWdPy1uw0t0jH/TAWyCr5OBGwF80R301LpeyVuCYhR20bt\nuwPahPyfPB32Jylr6yfqZKSgfnOZlSN/YhYRqiB7NRupTyyRT8Ls1TOZekWO\n/hJt\r\n=onIH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDEnFc5G0QKpH22H+Wv7TJm61JnFpW4dIcr+Gi08sA2qAiB0KcgqAwOGfyTvmjg+4gbAZql9SsPRNR3yZGvHH77mxQ=="}],"size":6778,"noattachment":false,"key":"/wordwrapjs/-/wordwrapjs-5.0.2.tgz"},"_npmUser":{"name":"75lb","email":"75pound@gmail.com"},"directories":{},"maintainers":[{"name":"75lb","email":"75pound@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wordwrapjs_5.0.2_1617041867583_0.10016422030491046"},"_hasShrinkwrap":false,"readme":"[![view on npm](https://badgen.net/npm/v/wordwrapjs)](https://www.npmjs.org/package/wordwrapjs)\n[![npm module downloads](https://badgen.net/npm/dt/wordwrapjs)](https://www.npmjs.org/package/wordwrapjs)\n[![Gihub repo dependents](https://badgen.net/github/dependents-repo/75lb/wordwrapjs)](https://github.com/75lb/wordwrapjs/network/dependents?dependent_type=REPOSITORY)\n[![Gihub package dependents](https://badgen.net/github/dependents-pkg/75lb/wordwrapjs)](https://github.com/75lb/wordwrapjs/network/dependents?dependent_type=PACKAGE)\n[![Node.js CI](https://github.com/75lb/wordwrapjs/actions/workflows/node.js.yml/badge.svg)](https://github.com/75lb/wordwrapjs/actions/workflows/node.js.yml)\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/feross/standard)\n\n# wordwrapjs\n\nWord wrapping for plain text.\n\n## Synopsis\n\nWrap some text in a 20 character column.\n\n```js\nimport wordwrap from 'wordwrapjs'\n\nconst text = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.'\nconst result = wordwrap.wrap(text, { width: 20 })\n```\n\n`result` now looks like this:\n```\nLorem ipsum dolor\nsit amet,\nconsectetur\nadipiscing elit, sed\ndo eiusmod tempor\nincididunt ut labore\net dolore magna\naliqua.\n```\n\nForce long words to wrap by setting the `break` flag.\n\n```\nWelcome to Node.js v16.6.2.\n> wrap = require('wordwrapjs')\n\n> url = 'https://github.com/75lb/wordwrapjs'\n> wrap.lines(url, { width: 18 })\n[ 'https://github.com/75lb/wordwrapjs' ]\n\n> wrap.lines(url, { width: 18, break: true })\n[ 'https://github.com', '/75lb/wordwrapjs' ]\n```\n\n## Load anywhere\n\nThis library is compatible with Node.js, the Web and any style of module loader. It can be loaded anywhere, natively without transpilation.\n\nNode.js:\n\n```js\nconst wordwrap = require('wordwrapjs')\n```\n\nWithin Node.js with ECMAScript Module support enabled:\n\n```js\nimport wordwrap from 'wordwrapjs'\n```\n\nWithin an modern browser ECMAScript Module:\n\n```js\nimport wordwrap from './node_modules/wordwrapjs/dist/index.mjs'\n```\n\nOld browser (adds `window.wordwrapjs`):\n\n```html\n<script nomodule src=\"./node_modules/wordwrapjs/dist/index.js\"></script>\n```\n\n## API Reference\n\n\n* [wordwrapjs](#module_wordwrapjs)\n    * [Wordwrap](#exp_module_wordwrapjs--Wordwrap) ⏏\n        * [new Wordwrap(text, [options])](#new_module_wordwrapjs--Wordwrap_new)\n        * _static_\n            * [.wrap(text, [options])](#module_wordwrapjs--Wordwrap.wrap)\n            * [.lines(text, [options])](#module_wordwrapjs--Wordwrap.lines)\n            * [.isWrappable(text)](#module_wordwrapjs--Wordwrap.isWrappable) ⇒ <code>boolean</code>\n            * [.getChunks(text)](#module_wordwrapjs--Wordwrap.getChunks) ⇒ <code>Array.&lt;string&gt;</code>\n        * _inner_\n            * [~WordwrapOptions](#module_wordwrapjs--Wordwrap..WordwrapOptions) : <code>Object</code>\n\n<a name=\"exp_module_wordwrapjs--Wordwrap\"></a>\n\n### Wordwrap ⏏\n**Kind**: Exported class  \n<a name=\"new_module_wordwrapjs--Wordwrap_new\"></a>\n\n#### new Wordwrap(text, [options])\n\n| Param | Type | Description |\n| --- | --- | --- |\n| text | <code>string</code> | The input text to wrap. |\n| [options] | [<code>WordwrapOptions</code>](#module_wordwrapjs--Wordwrap..WordwrapOptions) |  |\n\n<a name=\"module_wordwrapjs--Wordwrap.wrap\"></a>\n\n#### Wordwrap.wrap(text, [options])\n**Kind**: static method of [<code>Wordwrap</code>](#exp_module_wordwrapjs--Wordwrap)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| text | <code>string</code> | the input text to wrap |\n| [options] | [<code>WordwrapOptions</code>](#module_wordwrapjs--Wordwrap..WordwrapOptions) |  |\n\n<a name=\"module_wordwrapjs--Wordwrap.lines\"></a>\n\n#### Wordwrap.lines(text, [options])\nWraps the input text, returning an array of strings (lines).\n\n**Kind**: static method of [<code>Wordwrap</code>](#exp_module_wordwrapjs--Wordwrap)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| text | <code>string</code> | input text |\n| [options] | [<code>WordwrapOptions</code>](#module_wordwrapjs--Wordwrap..WordwrapOptions) |  |\n\n<a name=\"module_wordwrapjs--Wordwrap.isWrappable\"></a>\n\n#### Wordwrap.isWrappable(text) ⇒ <code>boolean</code>\nReturns true if the input text would be wrapped if passed into `.wrap()`.\n\n**Kind**: static method of [<code>Wordwrap</code>](#exp_module_wordwrapjs--Wordwrap)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| text | <code>string</code> | input text |\n\n<a name=\"module_wordwrapjs--Wordwrap.getChunks\"></a>\n\n#### Wordwrap.getChunks(text) ⇒ <code>Array.&lt;string&gt;</code>\nSplits the input text into an array of words and whitespace.\n\n**Kind**: static method of [<code>Wordwrap</code>](#exp_module_wordwrapjs--Wordwrap)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| text | <code>string</code> | input text |\n\n<a name=\"module_wordwrapjs--Wordwrap..WordwrapOptions\"></a>\n\n#### Wordwrap~WordwrapOptions : <code>Object</code>\nWordwrap options.\n\n**Kind**: inner typedef of [<code>Wordwrap</code>](#exp_module_wordwrapjs--Wordwrap)  \n**Properties**\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| [width] | <code>number</code> | <code>30</code> | The max column width in characters. |\n| [break] | <code>boolean</code> | <code>false</code> | If true, words exceeding the specified `width` will be forcefully broken |\n| [noTrim] | <code>boolean</code> | <code>false</code> | By default, each line output is trimmed. If `noTrim` is set, no line-trimming occurs - all whitespace from the input text is left in. |\n| [eol] | <code>string</code> | <code>&quot;&#x27;\\\\n&#x27;&quot;</code> | The end of line character to use. Defaults to `\\n`. |\n\n\n* * *\n\n&copy; 2015-21 Lloyd Brookes \\<75pound@gmail.com\\>. Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown).\n","publish_time":1617041867754,"_cnpm_publish_time":1617041867754,"dist-tags":{"latest":"5.1.1","next":"2.0.0-0"}}