stringbean

String helper methods that doesn't clobber the String prototype

Stringbean

Stringbean is a collection of string helper methods that dont't clobber the String prototype.

npm install stringbean
var stringbean = require('stringbean');

Converts HTML tags to entities

var someString = "<script>XSS Baby!</script>";
console.log(stringbean.escapeHTML(someString));

&lt;script&gt;XSS Baby!&lt;/script&gt;

Removes non alphanumeric characters from a string

var someString = "$£@@$%^foo(*&^%$£!@";
console.log(stringbean.removeNonAlphanumeric(testString));

foo