Install $ npm install code-beautify Usage import beautify from 'code-beautify' beautify('const a = 1', 'js') // <span class="kwd">const</span> a <span class="opt">=</span> <span class="num">1</span> Supported languages markup Such as HTML、XML js JavaScript and JSX css sh Shell java