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.

Examples of ES Modules #210

Closed
Closed
@Sequoia

Description

@Sequoia

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 unfortunately do not clear it up for me:

import statements will only support files with an .mjs extension, and will import only ES modules, for now.

Also: 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
JavaScript so I'm keen to understand this better.

🙏 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.

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