\begin{quote}
Wordwrap a string with \href{https://en.wikipedia.org/wiki/ANSI_escape_code\#Colors_and_Styles}{\texttt{ ANSI escape codes}} \end{quote}
\hypertarget{md_sfcode_node_modules_karma_node_modules_wrap_ansi_readme_autotoc_md15343}{}\doxysection{Install}\label{md_sfcode_node_modules_karma_node_modules_wrap_ansi_readme_autotoc_md15343}

\begin{DoxyCode}{0}
\DoxyCodeLine{\$ npm install wrap-\/ansi }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_karma_node_modules_wrap_ansi_readme_autotoc_md15344}{}\doxysection{Usage}\label{md_sfcode_node_modules_karma_node_modules_wrap_ansi_readme_autotoc_md15344}

\begin{DoxyCode}{0}
\DoxyCodeLine{const chalk = require('chalk');}
\DoxyCodeLine{const wrapAnsi = require('wrap-\/ansi');}
\DoxyCodeLine{}
\DoxyCodeLine{const input = 'The quick brown ' + chalk.red('fox jumped over ') +}
\DoxyCodeLine{    'the lazy ' + chalk.green('dog and then ran away with the unicorn.');}
\DoxyCodeLine{}
\DoxyCodeLine{console.log(wrapAnsi(input, 20)); }

\end{DoxyCode}


\hypertarget{md_sfcode_node_modules_karma_node_modules_wrap_ansi_readme_autotoc_md15345}{}\doxysection{API}\label{md_sfcode_node_modules_karma_node_modules_wrap_ansi_readme_autotoc_md15345}
\hypertarget{md_sfcode_node_modules_karma_node_modules_wrap_ansi_readme_autotoc_md15346}{}\doxysubsection{wrap\+Ansi(string, columns, options?)}\label{md_sfcode_node_modules_karma_node_modules_wrap_ansi_readme_autotoc_md15346}
Wrap words to the specified column width.\hypertarget{md_sfcode_node_modules_karma_node_modules_wrap_ansi_readme_autotoc_md15347}{}\doxysubsubsection{string}\label{md_sfcode_node_modules_karma_node_modules_wrap_ansi_readme_autotoc_md15347}
Type\+: {\ttfamily string}

String with ANSI escape codes. Like one styled by \href{https://github.com/chalk/chalk}{\texttt{ {\ttfamily chalk}}}. Newline characters will be normalized to {\ttfamily \textbackslash{}n}.\hypertarget{md_sfcode_node_modules_karma_node_modules_wrap_ansi_readme_autotoc_md15348}{}\doxysubsubsection{columns}\label{md_sfcode_node_modules_karma_node_modules_wrap_ansi_readme_autotoc_md15348}
Type\+: {\ttfamily number}

Number of columns to wrap the text to.\hypertarget{md_sfcode_node_modules_karma_node_modules_wrap_ansi_readme_autotoc_md15349}{}\doxysubsubsection{options}\label{md_sfcode_node_modules_karma_node_modules_wrap_ansi_readme_autotoc_md15349}
Type\+: {\ttfamily object}\hypertarget{md_sfcode_node_modules_karma_node_modules_wrap_ansi_readme_autotoc_md15350}{}\doxyparagraph{hard}\label{md_sfcode_node_modules_karma_node_modules_wrap_ansi_readme_autotoc_md15350}
Type\+: {\ttfamily boolean}~\newline
 Default\+: {\ttfamily false}

By default the wrap is soft, meaning long words may extend past the column width. Setting this to {\ttfamily true} will make it hard wrap at the column width.\hypertarget{md_sfcode_node_modules_karma_node_modules_wrap_ansi_readme_autotoc_md15351}{}\doxyparagraph{word\+Wrap}\label{md_sfcode_node_modules_karma_node_modules_wrap_ansi_readme_autotoc_md15351}
Type\+: {\ttfamily boolean}~\newline
 Default\+: {\ttfamily true}

By default, an attempt is made to split words at spaces, ensuring that they don\textquotesingle{}t extend past the configured columns. If word\+Wrap is {\ttfamily false}, each column will instead be completely filled splitting words as necessary.\hypertarget{md_sfcode_node_modules_karma_node_modules_wrap_ansi_readme_autotoc_md15352}{}\doxyparagraph{trim}\label{md_sfcode_node_modules_karma_node_modules_wrap_ansi_readme_autotoc_md15352}
Type\+: {\ttfamily boolean}~\newline
 Default\+: {\ttfamily true}

Whitespace on all lines is removed by default. Set this option to {\ttfamily false} if you don\textquotesingle{}t want to trim.\hypertarget{md_sfcode_node_modules_karma_node_modules_wrap_ansi_readme_autotoc_md15353}{}\doxysection{Related}\label{md_sfcode_node_modules_karma_node_modules_wrap_ansi_readme_autotoc_md15353}

\begin{DoxyItemize}
\item \href{https://github.com/chalk/slice-ansi}{\texttt{ slice-\/ansi}} -\/ Slice a string with ANSI escape codes
\item \href{https://github.com/sindresorhus/cli-truncate}{\texttt{ cli-\/truncate}} -\/ Truncate a string to a specific width in the terminal
\item \href{https://github.com/chalk/chalk}{\texttt{ chalk}} -\/ Terminal string styling done right
\item \href{https://github.com/mathiasbynens/jsesc}{\texttt{ jsesc}} -\/ Generate ASCII-\/only output from Unicode strings. Useful for creating test fixtures.
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_karma_node_modules_wrap_ansi_readme_autotoc_md15354}{}\doxysection{Maintainers}\label{md_sfcode_node_modules_karma_node_modules_wrap_ansi_readme_autotoc_md15354}

\begin{DoxyItemize}
\item \href{https://github.com/sindresorhus}{\texttt{ Sindre Sorhus}}
\item \href{https://github.com/qix-}{\texttt{ Josh Junon}}
\item \href{https://github.com/bcoe}{\texttt{ Benjamin Coe}}
\end{DoxyItemize}

\DoxyHorRuler{0}


 {\bfseries{ \href{https://tidelift.com/subscription/pkg/npm-wrap_ansi?utm_source=npm-wrap-ansi&utm_medium=referral&utm_campaign=readme}{\texttt{ Get professional support for this package with a Tidelift subscription}} }} ~\newline
 \textsubscript{ Tidelift helps make open source sustainable for maintainers while giving companies~\newline
assurances about security, maintenance, and licensing for their dependencies. }  