{"name":"wrap-ansi","version":"8.0.0","description":"Wordwrap a string with ANSI escape codes","license":"MIT","repository":{"type":"git","url":"git+https://github.com/chalk/wrap-ansi.git"},"funding":"https://github.com/chalk/wrap-ansi?sponsor=1","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=12"},"scripts":{"test":"xo && nyc ava"},"keywords":["wrap","break","wordwrap","wordbreak","linewrap","ansi","styles","color","colour","colors","terminal","console","cli","string","tty","escape","formatting","rgb","256","shell","xterm","log","logging","command-line","text"],"dependencies":{"ansi-styles":"^6.0.0","string-width":"^5.0.0","strip-ansi":"^7.0.0"},"devDependencies":{"ava":"^3.15.0","chalk":"^4.1.0","coveralls":"^3.1.0","has-ansi":"^5.0.0","nyc":"^15.1.0","xo":"^0.38.2"},"gitHead":"03b1cdf921da59050d38da8681d20f3c39cbb206","bugs":{"url":"https://github.com/chalk/wrap-ansi/issues"},"homepage":"https://github.com/chalk/wrap-ansi#readme","_id":"wrap-ansi@8.0.0","_nodeVersion":"14.16.1","_npmVersion":"6.14.10","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-Z8D7Y4g4l2rDGMwV1NtKjqbhNoXWQK264I38RoO4eDKqOKIeL2HUi/Uf0OG9+4XRlfxZ0OPGL4c2DTrnV+G/RQ==","shasum":"e88582542110439a7afe1a85315a1a6abd230ec3","tarball":"http://registry-npm.ywwl.com/wrap-ansi/download/wrap-ansi-8.0.0.tgz","fileCount":4,"unpackedSize":10420,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeT90CRA9TVsSAnZWagAAu5cP/RG92AzX1704nVFnjsjn\nOAyysWY9Of+wiWYouI+4mxUbot42pkHg2ZKZLo2cM/ZHA4GWJrBkuL7x4iii\n7A7lJ7WojA/GKBnMKyJQiBzqX7GkzNYiqNk0RruYIDYNjJio4uIjyZyoL4FG\nL6/K/r7SqNRI8NJsehOUtpzcEmmnJqwqfPFmzM1n391+jeUrW/KXV5Dn4amq\n52Y0MCN12esaByPtVrpgjG57KmSg6DZbk1LGaqs50e2/kWhQmglbdbQPMMhC\n22XZh5IMwADQG5ZCNus0ux+XPRTYKtiO09aypy+dgvyGhdkBPwntIAlgPGPg\niz7lt36zpiIpXjU/TPgTnkQ59Gc7iO7OWZ18JcLb1Abm1NS5lmP9HTpyEwbY\nIDT1z6ZlJTBkPmhYFYm27svgZ6c+/oPaL7t8wt0KvD466gcV1tQ4D8NCSG2n\na4svqREO1GJ1trsNXw6926LMbvp/2MKk+EfzJwhW0lUsgo+L2EM1KBU6g3GR\nrptuSPXNf6JIcVVj+Ff55Lmh0ZvtXFnh70FsTuUHE75OgMf7QAFpiRFl8rNR\nNOemKoUtAqRfjanaFNqEAVHyrz/EcLchKVV7wQsdGAiBmSMylJU8+85kx9sR\nPQNPdrlzI8rgrggXOg9Z8TbzMisx0jB/ZQnRO2cLLhn20YaWHHJLN/0vkfvg\n5rz+\r\n=18PU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDPRRhVgvL4otkCQKUckS3PZB7k11QRnNCv6qSbA3ikjQIhAJn/cUatdy3SM+qfie5HE2OtIwmEiLbmhR0sydsATMHH"}],"size":4266,"noattachment":false,"key":"/wrap-ansi/-/wrap-ansi-8.0.0.tgz"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"},{"name":"qix","email":"i.am.qix@gmail.com"},{"name":"bcoe","email":"bencoe@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wrap-ansi_8.0.0_1618558835950_0.3500820492029739"},"_hasShrinkwrap":false,"readme":"# wrap-ansi\n\n> Wordwrap a string with [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles)\n\n## Install\n\n```sh\nnpm install wrap-ansi\n```\n\n## Usage\n\n```js\nimport chalk from 'chalk';\nimport wrapAnsi from 'wrap-ansi';\n\nconst input = 'The quick brown ' + chalk.red('fox jumped over ') +\n\t'the lazy ' + chalk.green('dog and then ran away with the unicorn.');\n\nconsole.log(wrapAnsi(input, 20));\n```\n\n<img width=\"331\" src=\"screenshot.png\">\n\n## API\n\n### wrapAnsi(string, columns, options?)\n\nWrap words to the specified column width.\n\n#### string\n\nType: `string`\n\nA string with ANSI escape codes, like one styled by [`chalk`](https://github.com/chalk/chalk).\n\nNewline characters will be normalized to `\\n`.\n\n#### columns\n\nType: `number`\n\nThe number of columns to wrap the text to.\n\n#### options\n\nType: `object`\n\n##### hard\n\nType: `boolean`\\\nDefault: `false`\n\nBy default the wrap is soft, meaning long words may extend past the column width. Setting this to `true` will make it hard wrap at the column width.\n\n##### wordWrap\n\nType: `boolean`\\\nDefault: `true`\n\nBy default, an attempt is made to split words at spaces, ensuring that they don't extend past the configured columns. If wordWrap is `false`, each column will instead be completely filled splitting words as necessary.\n\n##### trim\n\nType: `boolean`\\\nDefault: `true`\n\nWhitespace on all lines is removed by default. Set this option to `false` if you don't want to trim.\n\n## Related\n\n- [slice-ansi](https://github.com/chalk/slice-ansi) - Slice a string with ANSI escape codes\n- [cli-truncate](https://github.com/sindresorhus/cli-truncate) - Truncate a string to a specific width in the terminal\n- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right\n- [jsesc](https://github.com/mathiasbynens/jsesc) - Generate ASCII-only output from Unicode strings. Useful for creating test fixtures.\n","publish_time":1618558836092,"_cnpm_publish_time":1618558836092,"dist-tags":{"latest":"10.0.2","next":"2.1.0-candidate"}}