Okay, great. How?
It sounds like there might be something wrong with the way you are using
require or with the way the function is exported in the file you are including with
require. You are on the right track. You just need to debug this by a process of elimination.
This would probably get better responses on stackoverflow tbh.