JavaScript module for stripping HTML tags and/or HTML element attributes from strings.html
npm install js-striphtmlnpm
var striphtml = require('js-striphtml'); striphtml.striptags('<body>I am a <b>HTML</b> string.<div class="clear"></div></body>', [ 'b' ]); // Returns "I am a <b>HTML</b> string."
var striphtml = require('js-striphtml'); striphtml.stripAttr('<p style="background:green">I am a <b>HTML</b> string. <img src="stringimg.jpg" align="right" /></p>', { 'img': [ 'src' ] } ); // Returns "<p>I am a <b>HTML</b> string. <img src="stringimg.jpg" /></p>"