{"name":"wordwrapjs","author":{"name":"Lloyd Brookes","email":"75pound@gmail.com"},"version":"2.0.0","description":"Word-wrapping for javascript.","repository":{"type":"git","url":"git+https://github.com/75lb/wordwrapjs.git"},"license":"MIT","main":"index.js","keywords":["word","line","wrap","text","columns"],"engines":{"node":">=0.12.0"},"scripts":{"test":"node test.js","docs":"jsdoc2md -t jsdoc2md/README.hbs src/lib/*.js > README.md; echo","es5":"rm -rf es5 && babel --presets babel-preset-es2015 --no-comments src --out-dir es5"},"devDependencies":{"babel-preset-es2015":"^6.18.0","core-assert":"^0.2.1","jsdoc-to-markdown":"^2.0.1","test-runner":"~0.2.5"},"dependencies":{"array-back":"^1.0.3","feature-detect-es6":"^1.3.1","reduce-flatten":"^1.0.1","typical":"^2.6.0"},"gitHead":"a2c68cf3ad0b3718000898edf63b15cebce1a47b","bugs":{"url":"https://github.com/75lb/wordwrapjs/issues"},"homepage":"https://github.com/75lb/wordwrapjs#readme","_id":"wordwrapjs@2.0.0","_shasum":"ab55f695e6118da93858fdd70c053d1c5e01ac20","_from":".","_npmVersion":"3.10.9","_nodeVersion":"7.2.0","_npmUser":{"name":"75lb","email":"75pound@gmail.com"},"dist":{"shasum":"ab55f695e6118da93858fdd70c053d1c5e01ac20","tarball":"http://registry-npm.ywwl.com/wordwrapjs/download/wordwrapjs-2.0.0.tgz","integrity":"sha512-XNzRwovxCFgLxqmumTWdVAIjtvMKAfjzdB/uWgILQiOPwIFNTq9xk5ZKPvcaVX9MCZueoSV2aGtSbM3irVap3w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCBV6PRP39sQhix6rivgblsf7ksaYK3ClXwKr33MoBhHAIgEi2pxsPn2yCeYf8ujYijURj2eS1tj+yaeyPmP++0B8s="}],"size":6384,"noattachment":false,"key":"/wordwrapjs/-/wordwrapjs-2.0.0.tgz"},"maintainers":[{"name":"75lb","email":"75pound@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/wordwrapjs-2.0.0.tgz_1480861996362_0.39469355694018304"},"directories":{},"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":1480861996970,"_cnpm_publish_time":1480861996970,"dist-tags":{"latest":"5.1.1","next":"2.0.0-0"}}