DEV Community

[Comment from a deleted post]
Collapse
 
shadowtime2000 profile image
shadowtime2000

I'd prob use it if they support CommonJS. using static import statements feel weird especially on server side.

Collapse
 
hanna profile image
Hanna Rose

At least import follows the ECMAScript specifications!

Collapse
 
shadowtime2000 profile image
shadowtime2000

Well, technically, require does follow ECMAScript specifications because it is a valid Javascript function. But, I see your point on that.

 
hanna profile image
Hanna Rose • Edited

Require isn't part of the ECMA specifications, it's part of CommonJS. As read here when you enable ES modules for your package.

 
qm3ster profile image
Mihail Malo

I think they mean that is syntactically/semantically looks like just a global function (even it if is not implemented as such in node).
In fact, that's what it was in web commonjs.

Collapse
 
andreespirela profile image
andreespirela

It does support it. Deno standard library has support for โ€œrequireโ€, deno.land/std@0.73.0/node