import in NodeJS
'import'
is a feature introduced in ES6 (ECMAScript 2015) for importing modules in JavaScript.- It’s used to load modules, similar to
require()
, but it’s more modern and standardized. 'import'
is asynchronous and supports lazy loading, meaning it loads modules only when needed, which can improve performance.