Package Exports
- extfs
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (extfs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Extension for Node.js fs module
##Table of Contents:
- [getDirs(path, cb)](#getDirs)
- [getDirsSync(path)](#getDirsSync)
- [isEmpty(path, cb)](#isEmpty)
- [isEmptySync(path)](#isEmptySync)
getDirs(path, cb)
Get all directories from a path
Example:
var fs = require('extfs');
fs.getDirs('/home/myFolder', function (err, dirs) {
if (err) {
throw err;
}
console.log(dirs); // Array of directories
});
getDirsSync(path)
(Synchronously) Get all directories from a path
Example:
var fs = require('extfs');
var dirs = fs.getDirsSync('/home/myFolder');
console.log(dirs); // Array of directories
isEmpty(path, cb)
Check if a file or directory is empty. A file is empty if not exists or not have any content. A directory is empty if not exists or not have any file inside.
Example:
var fs = require('extfs');
fs.isEmpty('/home/myFolder', function (empty) {
console.log(empty);
});
isEmptySync(path)
(Synchronously) Check if a file or directory is empty. A file is empty if not exists or not have any content. A directory is empty if not exists or not have any file inside.
Example:
var fs = require('extfs');
var empty = fs.isEmptySync('/home/myFolder');
console.log(empty);