{"name":"wrap-ansi","version":"8.0.1","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.1.0","string-width":"^5.0.1","strip-ansi":"^7.0.1"},"devDependencies":{"ava":"^3.15.0","chalk":"^4.1.2","coveralls":"^3.1.1","has-ansi":"^5.0.1","nyc":"^15.1.0","xo":"^0.44.0"},"gitHead":"99ada39978a880d8e0c060b6a972b552fddbb380","bugs":{"url":"https://github.com/chalk/wrap-ansi/issues"},"homepage":"https://github.com/chalk/wrap-ansi#readme","_id":"wrap-ansi@8.0.1","_nodeVersion":"12.22.1","_npmVersion":"7.20.3","dist":{"integrity":"sha512-QFF+ufAqhoYHvoHdajT/Po7KoXVBPXS2bgjIam5isfWJPfIOnQZ50JtUiVvCv/sjgacf3yRrt2ZKUZ/V4itN4g==","shasum":"2101e861777fec527d0ea90c57c6b03aac56a5b3","tarball":"http://registry-npm.ywwl.com/wrap-ansi/download/wrap-ansi-8.0.1.tgz","fileCount":4,"unpackedSize":10421,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhP5XdCRA9TVsSAnZWagAALUUP/RuULtr0v0iIk2aD9HPa\nJUlxyBnp8V4S6vUe4mZv9HiLDHQigbWN0T//RwQGag5sqpB6a3JoC62Ng/ox\nnjQD6i0rMpwEe80Fa9Q1sG8PcHFtOqhz/4z8kAPkHwoinUHIqBL3VOiTEhQf\nr8hvb+1Xj+qR3TxZU5+8MYKklyOgDPk7PHcMg7Lrd36zpmghsEQP8fdxtBOA\neI74GOjOAIp1W8x8vaUAgsjzyYR3I7HwvVXgTk2S+LLyv0LVmME7LEtTZ2Sh\nBKraI9frXb2BxytVOjLJRx9MUKKGp4C8K3ABbYqjLLBskxUyQs/aITV8LHFz\nMFQh+EEHNlXug21ayqujTloAUc/WEOhc35OUNEBOgo+1ORJsLpPEQ5urUB/L\nl8gn8hGUpmEJdIkZRTwptgxiKM0q8sdm6+QTPoG4k5gV2bL3EPBfFSxDWTfX\nusZperIFsBM17CEh7vKoGeFxeai16EUvFcTQntbyWpbY234tya3DUNFPloKb\nYwOdwYa6KNFmZCMo3x6zFDCgPgIdIs0Y0/JYAq81hCBgzlSH9hMd+tSWvBvG\nvZy/ylZryPfDzj1Sm1bSza+yu4uPpCLiv1/DBmYvNhAq8zhHQ6Lpd1nxpDKb\n9VwG1vd6g8wpPEGclPcRNURp1t4ETmXynxSTL3ZUA9bs8/veeBveNm5pPLcF\nk6Nk\r\n=AlPj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE/WZj6QschkIWaF+IJ6e0GxQ7JGYmuRAyPTgJN2+r2jAiBzJstRh7paEOhUhFjpMcgA9Gq1k4mFSEtVLXEZoxC1ew=="}],"size":4259,"noattachment":false,"key":"/wrap-ansi/-/wrap-ansi-8.0.1.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"},{"name":"qix","email":"josh@junon.me"},{"name":"bcoe","email":"bencoe@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wrap-ansi_8.0.1_1631557085839_0.030283861860827432"},"_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":1631557085982,"_cnpm_publish_time":1631557085982,"dist-tags":{"latest":"10.0.2","next":"2.1.0-candidate"}}