In ts-bridge, try to resolve the library first. If require.resolve throws an error, then ts-node is not available. This has no effect for JavaScript applications but means TypeScript projects will need to ensure they have ts-node and typescript installed.
In package.json, make ts-node an optional peer dependency.
This fixes runtime errors in JavaScript applications like this:
2021-03-16 02:35:31+0000: Error: Worker 1 initialization timed out
2021-03-16 02:35:31+0000: at Timeout._onTimeout (/opt/app/node_modules/thread-puddle/lib/index.js:225:20)
2021-03-16 02:35:31+0000: at listOnTimeout (internal/timers.js:549:17)
2021-03-16 02:35:31+0000: at processTimers (internal/timers.js:492:7)
In ts-bridge, try to resolve the library first. If require.resolve throws an error, then ts-node is not available. This has no effect for JavaScript applications but means TypeScript projects will need to ensure they have ts-node and typescript installed.
In package.json, make ts-node an optional peer dependency.
This fixes runtime errors in JavaScript applications like this:
2021-03-16 02:35:31+0000: Error: Worker 1 initialization timed out 2021-03-16 02:35:31+0000: at Timeout._onTimeout (/opt/app/node_modules/thread-puddle/lib/index.js:225:20) 2021-03-16 02:35:31+0000: at listOnTimeout (internal/timers.js:549:17) 2021-03-16 02:35:31+0000: at processTimers (internal/timers.js:492:7)
Fixes #6.