3 ms·
There's a huge philosophical difference between require and import/include. The main technical difference is that require is scoped! Philosophically require is
by z3t4 11y ago
There's a huge philosophical difference between require and import/include. The main technical difference is that require is scoped! Philosophically require is a object. While import is a bunch of code.
The Node community deliberately do not want code includes. We want you to make reusable modules instead.
Copy all your include files and the include files of your include files into one file. Then you will also see the problem.
- Illniyar 11y agoOnce the browsers (and therefor v8) will implement the module and loader specs, node.js will have import/exports. Comparability with javascript (and browsers) is more important then the community's dislike of imports (if there is such a thing), so I'm not sure if that is relevant here.