{"name":"wordwrapjs","author":{"name":"Lloyd Brookes","email":"75pound@gmail.com"},"version":"5.1.0","description":"Word-wrapping for javascript.","repository":{"type":"git","url":"git+https://github.com/75lb/wordwrapjs.git"},"license":"MIT","type":"module","exports":{"import":"./index.js","require":"./dist/index.cjs"},"keywords":["word","line","wrap","text","columns","wordwrap"],"engines":{"node":">=12.17"},"scripts":{"test":"npm run dist && npm run test:ci","test:ci":"test-runner test/test.?js","docs":"jsdoc2md -t README.hbs index.js > README.md","dist":"rollup -c"},"devDependencies":{"jsdoc-to-markdown":"^7.0.1","rollup":"^2.56.2","rollup-plugin-node-resolve":"^5.2.0","test-runner":"^0.9.8"},"standard":{"ignore":["dist","tmp"],"envs":[]},"gitHead":"a56f25b228eb7bece43a8174d5574fde4bb353ff","bugs":{"url":"https://github.com/75lb/wordwrapjs/issues"},"homepage":"https://github.com/75lb/wordwrapjs#readme","_id":"wordwrapjs@5.1.0","_nodeVersion":"16.6.2","_npmVersion":"7.20.6","dist":{"integrity":"sha512-JNjcULU2e4KJwUNv6CHgI46UvDGitb6dGryHajXTDiLgg1/RiGoPSDw4kZfYnwGtEXf2ZMeIewDQgFGzkCB2Sg==","shasum":"4c4d20446dcc670b14fa115ef4f8fd9947af2b3a","tarball":"http://registry-npm.ywwl.com/wordwrapjs/download/wordwrapjs-5.1.0.tgz","fileCount":8,"unpackedSize":26666,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhHNbgCRA9TVsSAnZWagAAshQQAJpB8+dMco1bfYbDHF3s\nrsxBWj8kV4yHCjmDe2n+kho9+5I8o2iDn3cYn9414+QxqnTerBY4XAZOsLcN\namMT+SAF/0M3cPgl0/vuYlcoug3OFbI+IZ7Iz49UMBGUhl7HgolPemSr7FRv\ngxV6KVHn84B63ltcB/qmM6ZHWpU+6Bit6fNS6pSeZhpFkv6XJgsYG5EhfsO6\nsyKCqALKAzp1VvdHd4Ss4JgpwVIP2obPpvg3PHBb7MZ9CVE2U7+UTV3IvW+w\naX8Qg1ZugaqSKbH0hKW9J1Ve6NurA3OpNGLL8UFG0mdGULivNXSHkk4PT0RK\nV58QW7c0aVlY3WMfL1aGeBcGkXly8wyHAXkojytGDEpvbaSWXSyq2dPKGTSt\nFIlkXTU0mV36ehg74HjiNlU8vtWrnsLEyKkfqhNNzBiKmuJwU0mZN4ouaYJ4\nhZAPO8XtJkCZJe+ScIgVatKLWZFvjstzL+vHUFqGRLdT3rc7bKzcoZf4DI/H\nZurNOZkaFj19BTEFGSk1wus1hf3M4mNQMsjymJ1vdQxGCz8wthDvEHhuNssU\nyIcdjyI7i3jE6N3faSrF7BGsuFZORu0keCv03irD2uqZe+P6fvYY2Y+b12K6\nP7QIIc8YA96O/JlCAQ+A8FSJWjiGm5GbCBjMdzlb+a0jLQwAUTE3CNqf6Esh\n2K+q\r\n=284g\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBbJGNfUXcCGRPA8MZSNaUa2v5LLqQb61RESsTLZts06AiEA1lo/9TA+U7PSpIV+i5EpLebf/IZptfyoY282I0zEurw="}],"size":4859,"noattachment":false,"key":"/wordwrapjs/-/wordwrapjs-5.1.0.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.1.0_1629279968353_0.6306622538858959"},"_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":1629279968510,"_cnpm_publish_time":1629279968510,"dist-tags":{"latest":"5.1.1","next":"2.0.0-0"}}