{"_id":"@cjser/wrap-ansi__v8_1_0","name":"@cjser/wrap-ansi__v8_1_0","dist-tags":{"latest":"8.1.0-cjser.2"},"versions":{"8.1.0-cjser.2":{"name":"@cjser/wrap-ansi__v8_1_0","version":"8.1.0-cjser.2","description":"Wordwrap a string with ANSI escape codes","license":"MIT","repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.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":{"types":"./index.d.ts","require":"./dist-cjser/index.cjs","default":"./index.js"},"engines":{"node":">=12"},"scripts":{"test":"xo && nyc ava && tsd"},"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":{"@cjser/ansi-styles":"6.2.3-cjser.2","@cjser/string-width__v5_1_2":"5.1.2-cjser.2","@cjser/strip-ansi":"7.2.0-cjser.2"},"devDependencies":{"ava":"^3.15.0","chalk":"^4.1.2","coveralls":"^3.1.1","has-ansi":"^5.0.1","nyc":"^15.1.0","tsd":"^0.25.0","xo":"^0.44.0"},"types":"./index.d.ts","main":"./dist-cjser/index.cjs","cjser":{"sourceVersion":"8.1.0","cjserVersion":2,"original":{"name":"wrap-ansi","version":"8.1.0","exports":{"types":"./index.d.ts","default":"./index.js"},"repository":"chalk/wrap-ansi","dependencies":{"ansi-styles":"^6.1.0","string-width":"^5.0.1","strip-ansi":"^7.0.1"},"files":["index.js","index.d.ts"],"scripts":{"test":"xo && nyc ava && tsd"}}},"_id":"@cjser/wrap-ansi__v8_1_0@8.1.0-cjser.2","gitHead":"a4bef54d7d22d3d9a6b84528457938d84cd65fe7","_nodeVersion":"20.14.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-EXADrUkpngWCE+LjKj5I1Vd/P2vpj84/bCOxPmEiGE/AfZopXdfS8f0tRPm7rSeC1aSLi2BnMzBhTzf1u+Y+4g==","shasum":"e7b610b2998df50603158a2b020a7c8fc39d5b3e","tarball":"https://registry.npmjs.org/@cjser/wrap-ansi__v8_1_0/-/wrap-ansi__v8_1_0-8.1.0-cjser.2.tgz","fileCount":6,"unpackedSize":20062,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC/JoHafryBVltrkIKHBM1SEdqe5l6xwwHfZW4RScJ9pwIgcNoN8nx652bwDdQYjWKFafbjuXeh4VgOnh4lKLH3WR4="}]},"_npmUser":{"name":"nanahira","email":"nanahira@momobako.com"},"directories":{},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/wrap-ansi__v8_1_0_8.1.0-cjser.2_1778160627045_0.2840398473216539"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-07T13:30:26.990Z","8.1.0-cjser.2":"2026-05-07T13:30:27.186Z","modified":"2026-05-07T13:30:27.366Z"},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"description":"Wordwrap a string with ANSI escape codes","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":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"license":"MIT","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```\n$ npm 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\nString with ANSI escape codes. Like one styled by [`chalk`](https://github.com/chalk/chalk). Newline characters will be normalized to `\\n`.\n\n#### columns\n\nType: `number`\n\nNumber 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\n## Maintainers\n\n- [Sindre Sorhus](https://github.com/sindresorhus)\n- [Josh Junon](https://github.com/qix-)\n- [Benjamin Coe](https://github.com/bcoe)\n\n---\n\n<div align=\"center\">\n\t<b>\n\t\t<a href=\"https://tidelift.com/subscription/pkg/npm-wrap_ansi?utm_source=npm-wrap-ansi&utm_medium=referral&utm_campaign=readme\">Get professional support for this package with a Tidelift subscription</a>\n\t</b>\n\t<br>\n\t<sub>\n\t\tTidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.\n\t</sub>\n</div>\n\n## cjser\n\nThis package is a CommonJS-compatible build generated by cjser for projects that still need `require()` support. The source version matches the original npm package version, with a cjser prerelease suffix for this generated build.\nOriginal repository: https://github.com/chalk/wrap-ansi\n","readmeFilename":"readme.md","_rev":"1-37a62388f435bcee2ec12a3455ecdf9b"}