镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Export ts-node/esm-register to use with --import #2072

Open

Description

@jlenon7

Desired Behavior

Register the ts-node/esm loader using the register function. Example of use:

node --import=ts-node/esm-register

The content of the file would be something like this:

import { register } from 'node:module'
import { pathToFileURL } from 'node:url'

register('ts-node/esm', pathToFileURL('./'))

Is this request related to a problem?

No.

Alternatives you've considered

.

Additional context

.

Activity

  1. AaronNGray commented on Jan 16, 2024

    @AaronNGray

    For further context and alternative example see :- #2100

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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