file-system
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -12,4 +12,2 @@ module.exports = function(grunt) { | ||
}); | ||
}; |
@@ -63,4 +63,12 @@ /** | ||
util.extend(exports, fs); | ||
/** | ||
* @description | ||
* Assign node origin methods to fs | ||
*/ | ||
exports.fs = fs; | ||
/** | ||
* @description | ||
* Create dir, if dir don't exists, it will not throw error. | ||
@@ -67,0 +75,0 @@ * And will mkdir for path, it is asynchronous. |
{ | ||
"name": "file-system", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Strengthen the ability of file system", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -14,7 +14,16 @@ ## file-system | ||
``` | ||
npm install file-system | ||
npm install file-system --save | ||
``` | ||
## API | ||
### file.fs | ||
file extend node fs origin methods, and overwrite some methods with next list chart | ||
if you want to use origin method, choose file.fs[method] | ||
``` | ||
file.existsSync === file.fs.existsSync // true | ||
file.fs.mkdirSync // orign method | ||
``` | ||
### file.mkdir | ||
@@ -46,2 +55,6 @@ The api is same as node's mkdir | ||
}); | ||
// Only using files | ||
file.recurse('path', function(filepath, filename) { | ||
if (!filename) return; | ||
}); | ||
``` | ||
@@ -74,5 +87,11 @@ | ||
file.copySync('path', 'dest'); | ||
file.copySync('src', 'dest/src'); | ||
file.copySync('src', 'dest/src', { filter: ['*.js', 'path/**/*.css'] }); | ||
file.copySync('path', 'dest', { process: function(contents, filepath) {} }); | ||
//Handler self files | ||
file.copySync('path', 'path', { filter: ['*.html.js'], process: function(contents, filepath) {} }); | ||
``` |
@@ -5,3 +5,2 @@ var util = require('util'); | ||
function isObject(arg) { | ||
@@ -43,3 +42,2 @@ return toString.call(arg) == '[object Object]'; | ||
extend(exports, util); | ||
@@ -46,0 +44,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
22552
10
692
94
5