-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Closed as not planned
Labels
esmIssues and PRs related to the ECMAScript Modules implementation.Issues and PRs related to the ECMAScript Modules implementation.feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.
Description
What is the problem this feature will solve?
Currently, import.meta.url gets the current file's absolute file path in URL format. This format cannot be used with node:path for creating absolute file paths.
The proposed additional properties will provide the current file's file path details in a format that can be used with node:path.
What is the feature you are proposing to solve the problem?
import.meta should provide the following additional properties:
directoryfile
Example
Given the following absolute file path (on Windows):
C:\user\repos\mine\main.js
… import.meta would provide the following properties:
{
"directory" : "C:\\user\\repos\\mine\\"
"file" : "main.js"
"url" : "file:///C:/user/repos/mine/main.js"
}sindresorhus and bburns
Metadata
Metadata
Assignees
Labels
esmIssues and PRs related to the ECMAScript Modules implementation.Issues and PRs related to the ECMAScript Modules implementation.feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.