3 ms·
Actually in node at least modules can export functions directly, just assign a function to `module.exports` and when you require() that module you'll get a func
by substack 15y ago
Actually in node at least modules can export functions directly, just assign a function to `module.exports` and when you require() that module you'll get a function back. Plus you can add attributes to that function since functions are also objects.
- olegp 15y agoThat's cool, I had overlooked that. I guess the point is that there's no key value store for modules, whereas for packages there's npm.