I have a typescript project and rather than using tsc
first, I'm just running via ts-node
directly.
In my code I need to create a child process with fork()
.
If I run code like child_process.fork('ChildProcess.ts')
and ChildProcess.ts
contains some typescript only constructs (eg: import {}
, export
, ...), then the interpreter being node
, not ts-node
, will fail.
It may be recommended to use something like child_process.exec('node ./node_modules/.bin/ts-node ChildProcess.ts)
, but I really want/need the IPC communication channel that gets set up between the parent and child processes when fork()
specifically is used.
Any ideas on how to achieve this?
Thanks!