A quick snippet from the TiDev Slack group to calculate the folder size (e.g. of the applicationDataDirectoy) without any external plug-in:
const recurseDirSize = async (dir) => {
let file = Ti.Filesystem.getFile(dir);
let size = 0;
if (file.isDirectory()) {
let subdirs = file.getDirectoryListing();
for (let subdir of subdirs) {
size += await recurseDirSize(dir + '/' + subdir);
}
} else if (file.isFile()) {
size = file.size;
}
return size || 0;
};
const dir = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory).resolve();
const size = await recurseDirSize(dir);
console.log("Folder size:", size);