Skip to content
This repository was archived by the owner on Sep 2, 2023. It is now read-only.
This repository was archived by the owner on Sep 2, 2023. It is now read-only.

import: urls in Node #222

@guybedford

Description

@guybedford

The current directions of import name maps are to bring these maps to other resources on the web as well, such as CSS and asset loads, using an import: URL. These URLs would be bare specifiers which would then be looked up in the package map themselves.

Node.js could in theory also support these. And where this might come in useful is all of our current use cases around fs.readFile(new URL('./x', import.meta.url)) where instead one might write fs.readFile(new URL('import:x')). Similarly this could be useful for new Worker, if this constructor were to be extended to support a URL input.

Is this something we want to consider? If so, perhaps we should explore some of these use cases further and ensure that Node is also represented in these discussions on the import name maps spec.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions