Saving each parent directory as a JSON file for external processing.