Skip to content

any examples for register esm? #1798

Answered by cspotcode
pincman asked this question in Q&A
Jun 17, 2022 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

Node makes installing ESM hooks at runtime impossible, the only way is via the --loader flag. I'm on mobile but if you search around you may find discussions where people have written their own --loader but use our API to implement it. Basically, they're doing node --loader my-fancy-loader.js and then in that file, they're using our API to create the hooks, possibly wrapping or customizing in some way.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@rguldener
Comment options

Answer selected by cspotcode
Comment options

You must be logged in to vote
1 reply
@cspotcode
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants