Prune a directory to contain a set number of sub-directories, retention policy is recency. That is to say, oldest sub-directories are pruned first.
npm install dirkeeper
var keeper =// You wish to make '/myDir' only contain the 5 newest sub-directories
A count of 0 means prune all sub-directories:
var keeper =// You wish to make '/myDir' contain no sub-directories:
Additionally, a count >= the actual number of sub-directories means prune nothing.