Let me know what is not clear as I tried to be as elaborate as possible. May be I will add some diagrams to this. Thanks.
Let me know what is not clear as I tried to be as elaborate as possible. May be I will add some diagrams to this. Thanks.
import and export are the new es6 features. You can either use it enabling the experimental flag as documented here Node.js v11.10.0 Documentation
Or you can also write your entire node code with babeljs and use all the modern javascript features.
To know what all es6+ features are natively supported please refer the below site.
ES6, ES2016 and ES2017 support
My recommendation would be to use babel transpilation as that is the most safest.