Comparing version 0.4.1 to 0.6.1
@@ -10,4 +10,5 @@ require('mootools'); | ||
require('./src/node/http.js'); | ||
require('./src/node/util.js'); | ||
require('./src/zero_functions.js'); | ||
{ | ||
"name": "nyks", | ||
"version": "0.4.1", | ||
"version": "0.6.1", | ||
"description": "nodejs exupery style", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -20,2 +20,6 @@ nyks provide a set of "missing" stuffs in nodejs basic api. | ||
## util | ||
* require('util').md5(string) | ||
Return a hex encoded md5 hash | ||
## fs | ||
@@ -30,3 +34,5 @@ * require('fs').deleteFolderRecursive(path); | ||
* require('fs').filesizeSync(path); | ||
Filesize sync | ||
* require('fs').filemtimeSync(path); | ||
* require('fs').isFileSync(path) | ||
* require('fs').isDirectorySync(path) | ||
@@ -83,3 +89,6 @@ * require('fs').tmppath (ext) | ||
* String.prototype.rot13() | ||
Rot13 of current string | ||
# zero_functions | ||
@@ -86,0 +95,0 @@ * bool(val) |
String.implement({ | ||
replaces : function(hash){ | ||
replaces : function(hash) { | ||
var self = this; | ||
@@ -11,3 +11,3 @@ Object.each(hash, function(v, k){ | ||
//recursive version of replaces | ||
rreplaces : function(hash){ | ||
rreplaces : function(hash) { | ||
var tmp = "", i = this; | ||
@@ -21,16 +21,24 @@ do { | ||
startsWith: function(str){ | ||
startsWith : function(str) { | ||
return (this.indexOf(str) === 0); | ||
}, | ||
endsWith:function(str){ | ||
endsWith : function(str) { | ||
return str ? this.substr(-str.length) == str : true; | ||
}, | ||
stripEnd:function(end){ | ||
stripEnd : function(end) { | ||
return this.endsWith(end) ? this.substr(0, this.length - end.length) : this.toString(); | ||
}, | ||
stripStart:function(start){ | ||
stripStart : function(start) { | ||
return this.startsWith(start) ? this.substr(start.length) : this.toString(); | ||
}, | ||
// http://stackoverflow.com/q/617647 | ||
rot13 : function() { | ||
return this.replace(/[a-zA-Z]/g, function(a){ | ||
return String.fromCharCode( ((a=a.charCodeAt())<91?78:110)>a ? a+13 : a-13 ); | ||
}); | ||
} | ||
}); |
@@ -13,2 +13,12 @@ | ||
fs.isFileSync = function(file_path){ | ||
return fs.statSync(file_path).isFile(); | ||
} | ||
fs.isDirectorySync = function(file_path){ | ||
return fs.statSync(file_path).isDirectory(); | ||
} | ||
fs.md5File = function (file_path, callback){ | ||
@@ -27,2 +37,5 @@ var shasum = crypto.createHash('md5'); | ||
} | ||
fs.filemtimeSync = function(file_path){ | ||
return fs.statSync(file_path)["mtime"]; | ||
} | ||
@@ -29,0 +42,0 @@ |
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
14779
16
381
97