Title: Add __dirname and __filename on ES Modules · Issue #30771 · nodejs/node · GitHub
Open Graph Title: Add __dirname and __filename on ES Modules · Issue #30771 · nodejs/node
X Title: Add __dirname and __filename on ES Modules · Issue #30771 · nodejs/node
Description: Is your feature request related to a problem? Please describe. It's a feature request. Describe the solution you'd like Would be nice to add __dirname, and __filename. to ES Modules, I've read the docs, but also read TC39 proposal, they ...
Open Graph Description: Is your feature request related to a problem? Please describe. It's a feature request. Describe the solution you'd like Would be nice to add __dirname, and __filename. to ES Modules, I've read the ...
X Description: Is your feature request related to a problem? Please describe. It's a feature request. Describe the solution you'd like Would be nice to add __dirname, and __filename. to ES Modules, I'...
Opengraph URL: https://github.com/nodejs/node/issues/30771
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add __dirname and __filename on ES Modules","articleBody":"\u003c!--\r\nThank you for suggesting an idea to make Node.js better.\r\n\r\nPlease fill in as much of the template below as you're able.\r\n--\u003e\r\n\r\n**Is your feature request related to a problem? Please describe.**\r\nIt's a feature request.\r\n\r\n**Describe the solution you'd like**\r\nWould be nice to add __dirname, and __filename. to ES Modules, I've read the [docs](https://nodejs.org/dist/latest-v13.x/docs/api/esm.html#esm_no_code_require_code_code_exports_code_code_module_exports_code_code_filename_code_code_dirname_code), but also read [TC39 proposal](https://github.com/tc39/proposal-import-meta#introducing-lexical-variables-in-another-way), they don't decline using this variables.\r\n\r\n**Describe alternatives you've considered**\r\nI have no idea. By the way, I've added `__filename` and `__dirname` properties to `import.meta` instead of suggestion of [how to get these values](https://nodejs.org/dist/latest-v13.x/docs/api/esm.html#esm_no_code_require_code_code_exports_code_code_module_exports_code_code_filename_code_code_dirname_code).\r\n","author":{"url":"https://github.com/juanarbol","@type":"Person","name":"juanarbol"},"datePublished":"2019-12-03T01:14:45.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/30771/node/issues/30771"}
| 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:8a18a581-3d0b-adc3-119c-9044ecfa78c5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9A92:320E86:6E0B6D:A09B89:6A4E12AB |
| html-safe-nonce | 71e5ee774aaef2c6371ba461a07a17ea1f5ac53fe4f22e51376fc7cd71d989b3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QTkyOjMyMEU4Njo2RTBCNkQ6QTA5Qjg5OjZBNEUxMkFCIiwidmlzaXRvcl9pZCI6IjU3NTgyMzMwMTU5NjEzOTE3ODgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | b4e45ee8026ac7b5300483b32fc77eaf59a40a60ac0e8a3c0da95d850a5d9e40 |
| hovercard-subject-tag | issue:531643921 |
| 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/node/30771/issue_layout |
| twitter:image | https://opengraph.githubassets.com/442fca7a65cd7eb342dfd974c520cd46ad3dac63d0e48abdd012754cfdd0487c/nodejs/node/issues/30771 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/442fca7a65cd7eb342dfd974c520cd46ad3dac63d0e48abdd012754cfdd0487c/nodejs/node/issues/30771 |
| og:image:alt | Is your feature request related to a problem? Please describe. It's a feature request. Describe the solution you'd like Would be nice to add __dirname, and __filename. to ES Modules, I've read the ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | juanarbol |
| hostname | github.com |
| expected-hostname | github.com |
| None | 030096ee0db095447bfe77409d33bfac127ca7128299c58deef27c52eaa1b1f0 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| 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 | ea9187571e3edc5f2780f750631138669441ca50 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width