Title: Examples of ES Modules · Issue #210 · nodejs/modules · GitHub
Open Graph Title: Examples of ES Modules · Issue #210 · nodejs/modules
X Title: Examples of ES Modules · Issue #210 · nodejs/modules
Description: I have been attempting to follow the evolving discussion around ESM support in Node.js, but I'm very confused about some fundamental points, and I suspect others are as well. In particular, I can't figure out whether import only operate ...
Open Graph Description: I have been attempting to follow the evolving discussion around ESM support in Node.js, but I'm very confused about some fundamental points, and I suspect others are as well. In particular, I can't...
X Description: I have been attempting to follow the evolving discussion around ESM support in Node.js, but I'm very confused about some fundamental points, and I suspect others are as well. In particular, I c...
Opengraph URL: https://github.com/nodejs/modules/issues/210
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Examples of ES Modules","articleBody":"I have been attempting to follow the evolving discussion around ESM support in Node.js, but I'm very confused about some fundamental points, and I suspect others are as well. In particular, I can't figure out whether `import` only _operate on_ files with `mjs` extensions or work _within_ files with mjs extension. [Statements like this](https://github.com/nodejs/modules/blob/master/doc/plan-for-new-modules-implementation.md#phase-1-the-minimal-kernel) unfortunately do not clear it up for me:\r\n\r\n\u003e import statements will only support files with an .mjs extension, and will import only ES modules, for now.\r\n\r\nAlso: `module.createRequireFromPath`. I have no idea how I'd even start to use this method. I'm the \"javascript expert\" at my work but I struggle to explain the future (or present state) of module loading in \r\nJavaScript so I'm keen to understand this better.\r\n\r\n🙏 **Request**: Is a list of concrete examples in the offing? A blog post, a repository, or a gist of runnable examples would be very helpful.","author":{"url":"https://github.com/Sequoia","@type":"Person","name":"Sequoia"},"datePublished":"2018-10-25T13:48:11.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":14},"url":"https://github.com/210/modules/issues/210"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:3cf78ffe-6ce2-a5ef-c148-50b46144bc58 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DD52:3E399E:9105B0:CB2A01:6A4E80A7 |
| html-safe-nonce | 5dc71ed1fbf8b38aba3ebfec0be16679c69abc792f4ed0e3a6bfb0cdd930c646 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERDUyOjNFMzk5RTo5MTA1QjA6Q0IyQTAxOjZBNEU4MEE3IiwidmlzaXRvcl9pZCI6IjMwMjQyODg4NzA5MzU5ODYzNDMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 5ef1f50fa1e12cac262b624b8dc512104491e82938c9a70d9f2186cb7ad7a4d5 |
| hovercard-subject-tag | issue:373956752 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/modules/210/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6af2b85a92ad46ba415e94bd1a502f2bf846ec7d813d7e0c5d888d44fcb9cb88/nodejs/modules/issues/210 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6af2b85a92ad46ba415e94bd1a502f2bf846ec7d813d7e0c5d888d44fcb9cb88/nodejs/modules/issues/210 |
| og:image:alt | I have been attempting to follow the evolving discussion around ESM support in Node.js, but I'm very confused about some fundamental points, and I suspect others are as well. In particular, I can't... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Sequoia |
| hostname | github.com |
| expected-hostname | github.com |
| None | 41b6ab3ba6d20a71766ac245b5a4a94c6fc672a9cd4da7d44c1b33ab8bf6a21c |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/modules git https://github.com/nodejs/modules.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 119901830 |
| octolytics-dimension-repository_nwo | nodejs/modules |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 119901830 |
| octolytics-dimension-repository_network_root_nwo | nodejs/modules |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e6a744804e8e70f97b4d5a18a94dcc63db22f97a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width