ts-node icon indicating copy to clipboard operation
ts-node copied to clipboard

Export `ts-node/esm-register` to use with `--import`

Open jlenon7 opened this issue 2 years ago • 1 comments

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

.

jlenon7 avatar Oct 04 '23 14:10 jlenon7

For further context and alternative example see :- https://github.com/TypeStrong/ts-node/issues/2100

AaronNGray avatar Jan 16 '24 20:01 AaronNGray