Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

132
Views
ts-node and custom loaders

Is it possible to use ts-node and a custom loader? In the docs I only see a way to enable esm compatibility.

ts-node --esm my-file.ts

I am trying to use a custom loader for testing an ESM module but I don't want to use node to compile each time since this is for a test suite. The way to use (multiple) loaders in node is like so

node --loader=esm --loader=testdouble my-file.js
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Sure: Just use ts-node/esm as the loader value. This is documented as an environment variable in ts-node's README:

Or, if you require native ESM support:

NODE_OPTIONS="--loader ts-node/esm"

This tells any node processes which receive this environment variable to install ts-node's hooks before executing other code.

Be sure to understand:

  • the caveats of this loader: GitHub — TypeStrong/ts-node#1007
  • how the Loader API works in Node: Node.js — API > ESM > Loaders
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!