This code makes use of two classes: TsWorker and TsWorkerJob. TsWorker initializes an inline worker and runs one job. The TsWorker class needs to be initialized with a function and the function's arguments as an array.
const tsWorker = new TsWorker();
// create a new job. You can create a sub class of TsWorker so that you don't have to add the function any time.