Comparing version 0.0.3 to 0.0.4
@@ -0,1 +1,7 @@ | ||
### 0.0.4 / 2012-01-27 | ||
* Added trim() method for IE browsers | ||
* Moved string.coffee to lib/string.coffee | ||
* Now included a minified `string.js` named `string.min.js` | ||
* Updated README that now includes Browser usage instructions. | ||
### 0.0.3 / 2012-01-20 | ||
@@ -2,0 +8,0 @@ * Cleaned package.json file |
{ | ||
"name": "string", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "string contains methods that aren't included in the vanilla JavaScript string. It modifies your String prototype.", | ||
@@ -5,0 +5,0 @@ "homepage": [ |
@@ -16,4 +16,6 @@ # string.js | ||
## Usage | ||
## Usage | ||
### Node.js | ||
```coffeescript | ||
@@ -23,7 +25,31 @@ require('string') | ||
### Browsers (IE/Chrome/Safari/Firefox) | ||
```html | ||
<!-- HTML5 --> | ||
<script src="https://raw.github.com/jprichardson/string.js/master/string.min.js"/></script> | ||
<!-- Note that in the mime type for Javascript is now officially 'application/javascript'. If you | ||
set the type to application/javascript in IE browsers, your Javscript will fail. Just don't set a | ||
type via the script tag and set the mime type from your server. Most browsers look at the server mime | ||
type anyway --> | ||
<!-- For HTML4/IE --> | ||
<script type="text/javascript" src="https://raw.github.com/jprichardson/string.js/master/string.min.js"/></script> | ||
``` | ||
### Methods | ||
See [test file][1] for more details. | ||
```coffeescript | ||
coming | ||
includes(needle) or contains(needle) #true if string contains needle | ||
endsWith(suffix) #true if string ends with suffix | ||
startsWith(prefix) #true if string starts with prefix | ||
isAlpha() #true if string is only letters | ||
isDigit() #true if the string only contains digits | ||
isNumber() #true if the string can be converted to a valid Number object | ||
isAlphaDigit() #true if the string only contains letters or numbers | ||
``` | ||
@@ -41,4 +67,4 @@ | ||
[1]: https://github.com/jprichardson/string.js/blob/master/test/string.test.coffee | ||
@@ -37,2 +37,8 @@ (function() { | ||
if (typeof String.prototype.trim !== 'function') { | ||
String.prototype.trim = function() { | ||
return this.replace(/(^\s*|\s*$)/g, ''); | ||
}; | ||
} | ||
}).call(this); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9336
11
33
68