Closed rafaelfaria closed 9 years ago
File isn't the filename but rather a vinyl-fs file object, which has on it a stat prop. See https://github.com/wearefractal/vinyl-fs/blob/master/lib/src/index.js#L39
I used the following function
var isThereContent = function(file) {
var fd = fs.openSync(file.path, "r"),
fileStat = fs.fstatSync(fd);
if (fileStat.size > 50) {
return true;
} else {
return false;
}
}
var isThereContent = function(file) { return (file.stat.size > 50); }
I'm trying to filter some files by it's filesize but i'm getting some errors:
I'm trying to check if the file has some content in it (because sometimes it doesnt)
I get the following error:
Would you be able to help?