2 ms·
What about the createRequire function?
by throwAGIway 2y ago
What about the createRequire function?
- bastawhiz 2y agoWhy should I need to go out of my way to do this? Why do I need to care what kind of module I'm importing and reach into the stdlib to run code? It should just work.
- throwAGIway 2y agoTo be frank I don't care about these questions, perhaps you're right and it should, but whatever. It's a solution I used in the three cases it was necessary that blocked moving my codebase to ESM.
- sureIy 2y agoYou’re missing the point. Of course createRequire is a solution, it’s always been. The problem are tools and sub-dependencies that you can’t touch.