\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_wrap_ansi_readme_autotoc_md34215}{}\doxysection{Install}\label{md_sfcode_node_modules_wrap_ansi_readme_autotoc_md34215}

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

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

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




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

\DoxyHorRuler{0}
\hypertarget{md_sfcode_node_modules_wrap_ansi_readme_autotoc_md34219}{}\doxysection{API}\label{md_sfcode_node_modules_wrap_ansi_readme_autotoc_md34219}
\hypertarget{md_sfcode_node_modules_wrap_ansi_readme_autotoc_md34220}{}\doxysubsection{wrap\+Ansi(input, columns, \mbox{[}options\mbox{]})}\label{md_sfcode_node_modules_wrap_ansi_readme_autotoc_md34220}
Wrap words to the specified column width.\hypertarget{md_sfcode_node_modules_wrap_ansi_readme_autotoc_md34221}{}\doxysubsubsection{input}\label{md_sfcode_node_modules_wrap_ansi_readme_autotoc_md34221}
Type\+: {\ttfamily string}

String with ANSI escape codes. Like one styled by \href{https://github.com/chalk/chalk}{\texttt{ {\ttfamily chalk}}}.\hypertarget{md_sfcode_node_modules_wrap_ansi_readme_autotoc_md34222}{}\doxysubsubsection{columns}\label{md_sfcode_node_modules_wrap_ansi_readme_autotoc_md34222}
Type\+: {\ttfamily number}

Number of columns to wrap the text to.\hypertarget{md_sfcode_node_modules_wrap_ansi_readme_autotoc_md34223}{}\doxysubsubsection{options}\label{md_sfcode_node_modules_wrap_ansi_readme_autotoc_md34223}
Type\+: {\ttfamily Object}\hypertarget{md_sfcode_node_modules_wrap_ansi_readme_autotoc_md34224}{}\doxyparagraph{hard}\label{md_sfcode_node_modules_wrap_ansi_readme_autotoc_md34224}
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_wrap_ansi_readme_autotoc_md34225}{}\doxyparagraph{word\+Wrap}\label{md_sfcode_node_modules_wrap_ansi_readme_autotoc_md34225}
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_wrap_ansi_readme_autotoc_md34226}{}\doxyparagraph{trim}\label{md_sfcode_node_modules_wrap_ansi_readme_autotoc_md34226}
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_wrap_ansi_readme_autotoc_md34227}{}\doxysection{Related}\label{md_sfcode_node_modules_wrap_ansi_readme_autotoc_md34227}

\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_wrap_ansi_readme_autotoc_md34228}{}\doxysection{Maintainers}\label{md_sfcode_node_modules_wrap_ansi_readme_autotoc_md34228}

\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}\hypertarget{md_sfcode_node_modules_wrap_ansi_readme_autotoc_md34229}{}\doxysection{Security}\label{md_sfcode_node_modules_wrap_ansi_readme_autotoc_md34229}
To report a security vulnerability, please use the \href{https://tidelift.com/security}{\texttt{ Tidelift security contact}}. Tidelift will coordinate the fix and disclosure.\hypertarget{md_sfcode_node_modules_wrap_ansi_readme_autotoc_md34230}{}\doxysection{License}\label{md_sfcode_node_modules_wrap_ansi_readme_autotoc_md34230}
MIT 