I'm learning Nodejs and express. I've got some doubts about it, I don't understand which is the best practice for nodejs using import or require


I'm learning Nodejs and express. I've got some doubts about it, I don't understand which is the best practice for nodejs using import or require


The only "best practice" is what your organization has set.
The only real downfall, is developers on your team not knowing how to write modules for ES6.
I have done countless code reviews where the developer is using exports.func() and then importing it in another file.
Unless your team is seasoned and not new to JS, then pick one and don't combine them. Since you mentioned you are new, stick with CJS.
Reading materials: syntax differences between CJS & ES6 modules