Is there a way to pass options to node when invoking ts-node? I am trying to use an experimental feature in node and it would be swell if it would work with ts-node.
This is currently what I am doing:
ts-node ./src/utils/repl.ts -- --experimental-repl-await
I got it to work this way:
node --experimental-repl-await -r ts-node/register ./src/utils/repl.ts
From the ts-node
documentation:
Note: If you need to use advanced node.js CLI arguments (e.g.
--inspect
), use them withnode -r ts-node/register
instead of thets-node
CLI.
Another way to do it is to use the NODE_OPTIONS
environment variable. For instance, in a *nix-style shell:
NODE_OPTIONS=--experimental-repl-await ts-node ./src/utils/repl.ts
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With