nodejs utility to limit number of sub-directories