\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_protractor_node_modules_wrap_ansi_readme_autotoc_md23224}{}\doxysection{Install}\label{md_sfcode_node_modules_protractor_node_modules_wrap_ansi_readme_autotoc_md23224}

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

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

\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_protractor_node_modules_wrap_ansi_readme_autotoc_md23226}{}\doxysection{API}\label{md_sfcode_node_modules_protractor_node_modules_wrap_ansi_readme_autotoc_md23226}
\hypertarget{md_sfcode_node_modules_protractor_node_modules_wrap_ansi_readme_autotoc_md23227}{}\doxysubsection{wrap\+Ansi(string, columns, options?)}\label{md_sfcode_node_modules_protractor_node_modules_wrap_ansi_readme_autotoc_md23227}
Wrap words to the specified column width.\hypertarget{md_sfcode_node_modules_protractor_node_modules_wrap_ansi_readme_autotoc_md23228}{}\doxysubsubsection{string}\label{md_sfcode_node_modules_protractor_node_modules_wrap_ansi_readme_autotoc_md23228}
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_protractor_node_modules_wrap_ansi_readme_autotoc_md23229}{}\doxysubsubsection{columns}\label{md_sfcode_node_modules_protractor_node_modules_wrap_ansi_readme_autotoc_md23229}
Type\+: {\ttfamily number}

Number of columns to wrap the text to.\hypertarget{md_sfcode_node_modules_protractor_node_modules_wrap_ansi_readme_autotoc_md23230}{}\doxysubsubsection{options}\label{md_sfcode_node_modules_protractor_node_modules_wrap_ansi_readme_autotoc_md23230}
Type\+: {\ttfamily object}\hypertarget{md_sfcode_node_modules_protractor_node_modules_wrap_ansi_readme_autotoc_md23231}{}\doxyparagraph{hard}\label{md_sfcode_node_modules_protractor_node_modules_wrap_ansi_readme_autotoc_md23231}
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_protractor_node_modules_wrap_ansi_readme_autotoc_md23232}{}\doxyparagraph{word\+Wrap}\label{md_sfcode_node_modules_protractor_node_modules_wrap_ansi_readme_autotoc_md23232}
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_protractor_node_modules_wrap_ansi_readme_autotoc_md23233}{}\doxyparagraph{trim}\label{md_sfcode_node_modules_protractor_node_modules_wrap_ansi_readme_autotoc_md23233}
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_protractor_node_modules_wrap_ansi_readme_autotoc_md23234}{}\doxysection{Related}\label{md_sfcode_node_modules_protractor_node_modules_wrap_ansi_readme_autotoc_md23234}

\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_protractor_node_modules_wrap_ansi_readme_autotoc_md23235}{}\doxysection{Maintainers}\label{md_sfcode_node_modules_protractor_node_modules_wrap_ansi_readme_autotoc_md23235}

\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. }  