react-ansi-style
Convert a styled ansi string to react spans with classes for the styles
Example
var _ = ;var jsCss = ;var React = ;var ReactDOM = ;var reactAnsiStyle = ; //build up a styled string to test withvar chalk = ;chalkenabled = true;var test_styles = _;var ansi_string = _; //make this look like a terminal;;//default css styles ReactDOM;
API
reactAnsiStyle = require('react-ansi-style')
reactAnsiStyle(React, str, opts)
A function that returns an array of react span
elements with css classes to style the string.
React
- yes, pass in the React object, this avoids many of the React's peer-dependancy quirks.str
- the ansi string you want styled.opts.prefix
- a string prefix for the css classes, by default it's 'react-ansi-style-'
require('react-ansi-style/inject-css')
This will inject the default CSS styling.
License
MIT