can you not require a directory and all the exports in the dir create the required object