So the main point of this seems to be extracting the interface from the module and converting it into the OpenAI API call's functions format.
It's a good idea. But for me I would rather just have an npm package with a function like
extractFunctions(srcFilename)
which I could then use inside of my own project which already handles the rest of it.