/**
* File module.
* @namespace lib.file
* @author Taka Okunishi
*
*/
var prototype = require('./_prototype.js');
/**
* Define an object property getter to access prototype property.
* @private
*/
function getPrototypeProperty (key) {
return {
enumerable: true,
get: function () {
return prototype[key];
}
};
}
// Export prototype properties with lazy loading.
Object.defineProperties(exports, {
copyDir: getPrototypeProperty('copyDir'),
copyFile: getPrototypeProperty('copyFile'),
expandGlob: getPrototypeProperty('expandGlob'),
forceUnlink: getPrototypeProperty('forceUnlink'),
ignoreFilter: getPrototypeProperty('ignoreFilter'),
loadHbsTmpl: getPrototypeProperty('loadHbsTmpl'),
matchesGlob: getPrototypeProperty('matchesGlob'),
mkdirP: getPrototypeProperty('mkdirP'),
prepareCleanDir: getPrototypeProperty('prepareCleanDir'),
readdirRecursive: getPrototypeProperty('readdirRecursive'),
readdirRecursiveSync: getPrototypeProperty('readdirRecursiveSync'),
relativeSymlink: getPrototypeProperty('relativeSymlink'),
rmdirRecursive: getPrototypeProperty('rmdirRecursive'),
writeReadonlyFile: getPrototypeProperty('writeReadonlyFile')
});
/**
* Define an object property getter with require function.
* @private
*/
function getRequire (moduleName) {
return {
enumerable: true,
get: function () {
return require(moduleName);
}
};
}
// Export modules with lazy loading.
Object.defineProperties(exports, {
appendFile: getRequire('./append_file'),
filterDirectory: getRequire('./filter_directory')
});