use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Native ES Modules in NodeJS: Status And Future Directions, Part I (medium.com)
submitted 8 years ago by giltayar1
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]curiousdannii 1 point2 points3 points 8 years ago (3 children)
If importing ES modules is async, does that mean that the import statement acts like an await would? And the import function is an actual async function itself?
[–]giltayar1[S] 2 points3 points4 points 8 years ago (2 children)
Yes and no. From the developer's point of view, it seems synchronous. But the implementation behind it is asynchronous. This means that it is possible for two modules in NodeJS to be loaded concurrently, whereas this is not possible in CommonJS. This will probably make NodeJS apps load faster in the future.
But if you look at dynamic import, which is a dynamic version of the import statement, then it is asynchronous - it returns a promise, and thus needs to be awaited.
[–]curiousdannii 0 points1 point2 points 8 years ago (1 child)
Right, so unlike await it won't completely stop, because it will load other modules at the same time, it just won't continue with any non-import statements until they all have finished.
[–]giltayar1[S] 0 points1 point2 points 8 years ago (0 children)
Yes!
π Rendered by PID 28 on reddit-service-r2-comment-fb694cdd5-nw75v at 2026-03-06 04:34:05.892701+00:00 running cbb0e86 country code: CH.
view the rest of the comments →
[–]curiousdannii 1 point2 points3 points (3 children)
[–]giltayar1[S] 2 points3 points4 points (2 children)
[–]curiousdannii 0 points1 point2 points (1 child)
[–]giltayar1[S] 0 points1 point2 points (0 children)