0.3.0 • Published 12 years ago
stringbean v0.3.0
Stringbean
Stringbean is a collection of string helper methods that dont't clobber the String prototype.
Installation
npm install stringbeanUsage
var stringbean = require('stringbean');Methods
escapeHTML
Converts HTML tags to entities
var someString = "<script>XSS Baby!</script>";
console.log(stringbean.escapeHTML(someString));
<script>XSS Baby!</script>removeNonAlphanumeric
Removes non alphanumeric characters from a string
var someString = "$£@@$%^foo(*&^%$£!@";
console.log(stringbean.removeNonAlphanumeric(testString));
foo