nyks provide a set of "missing" stuffs in nodejs basic api.
All those functions will eventually end up in the official API :-).
-
require('nyks/fs/deleteFolderRecursive')(path);
Recursive folder deletion
-
require('nyks/fs/md5File')(file_path, callback)
-
require('nyks/fs/md5FileSync')(file_path)
Return md5 checksum of a file
-
require('nyks/fs/filesizeSync')(path);
-
require('nyks/fs/filemtimeSync')(path);
-
require('nyks/fs/isFileSync')(path)
-
require('nyks/fs/isDirectorySync')(path)
-
require('nyks/fs/tmppath')(ext)
Return a unique file path in OS temp dir
-
require('nyks/fs/getFolderSize')(path)
Return a folder Size
-
require('nyks/fs/clearFolderReccurcive')(path , options , callback) // options {file_to_keep:[] , size_to_delete:number(octet) , max_size:number(octet) , max_time:number(millisecond) }
delete files in folder (you can delete the files created before max_time or and delete with size options)