Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
String helper methods that don't clobber the String prototype
JavaScript
tag: v0.0.3

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
.gitignore
.travis.yml
LICENSE
README.md
package.json

README.md

Stringbean

Build Status

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

Installation

npm install stringbean

Usage

var stringbean = require('stringbean');

Methods

escapeHTML

Converts HTML tags to entities

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

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

removeNonAlphanumeric

Removes non alphanumeric characters from a string

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

foo
Something went wrong with that request. Please try again.