{"_id":"wrap-ansi@10.0.2","bugs":{"url":"https://github.com/chalk/wrap-ansi/issues"},"dist":{"shasum":"92f8f14b014136d034389a8700d6ce3df79c65d5","tarball":"http://registry-npm.ywwl.com/wrap-ansi/download/wrap-ansi-10.0.2.tgz","fileCount":5,"integrity":"sha512-6OLRNZqRntVGBm26ghZ5eZhCuWWyOkRCSn8XsOIuq5stpCE/tjLbdozd93naILZig0lmD8ANfRwnhn0DLeXGlg==","signatures":[{"sig":"MEQCIATDgbAg5x6ZRCd7iARI3SLL8d6chrBB+QqctaL6+46EAiAyiG2WG7GVLhNWVQtZ0oXMfpqrcbnp0EjGg4iuPkJgHg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC72TUscUJN516GlIFOgkea2KhM3Qwsd6+/SfpTdLnS2AIgHs5lDfRMvaOO2UVaFcpJxQttYw0MER36kkKktdNZ8gg="}],"unpackedSize":25896,"size":8332,"noattachment":false,"key":"/wrap-ansi/-/wrap-ansi-10.0.2.tgz"},"name":"wrap-ansi","type":"module","types":"./index.d.ts","author":{"url":"https://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"engines":{"node":">=20"},"exports":{"types":"./index.d.ts","default":"./index.js"},"funding":"https://github.com/chalk/wrap-ansi?sponsor=1","gitHead":"4e44ec236852ac3ca28a554dbc3b5fc396346f1d","license":"MIT","scripts":{"test":"xo && node --test && tsd"},"version":"10.0.2","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"homepage":"https://github.com/chalk/wrap-ansi#readme","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"],"repository":{"url":"git+https://github.com/chalk/wrap-ansi.git","type":"git"},"_npmVersion":"12.0.1","description":"Wordwrap a string with ANSI escape codes","directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_nodeVersion":"26.9.0","dependencies":{"ansi-styles":"^6.2.3","string-width":"^8.2.0"},"_hasShrinkwrap":false,"devDependencies":{"xo":"^1.2.3","tsd":"^0.33.0","chalk":"^5.6.2","has-ansi":"^6.0.2","strip-ansi":"^7.1.2"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/wrap-ansi_10.0.2_1789963772182_0.548713483073429"},"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\nTab characters are expanded to spaces using 8-column tab stops before wrapping.\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":1789963772260,"_cnpm_publish_time":1789963772260,"dist-tags":{"latest":"10.0.2","next":"2.1.0-candidate"}}