UNPKG

expressmultithread

Version:

Fast, light-weight and low dependency [Express.js](https://www.npmjs.com/package/express) multithreaded router.

23 lines 811 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.registerTS = void 0; const worker_threads_1 = require("worker_threads"); const ts_node_1 = require("ts-node"); const isCompiled_1 = require("../../constants/isCompiled"); if (worker_threads_1.isMainThread) throw new Error("This file should not be imported in the main thread"); const moduleCompiled = __filename.endsWith(".js"); let registered = undefined; function registerTS(config) { if (!moduleCompiled || isCompiled_1.isCompiled) return; if (registered) registered.enabled(false); registered = (0, ts_node_1.register)(config ? require(config) : { compilerOptions: { strict: false } }); } exports.registerTS = registerTS; //# sourceMappingURL=register.js.map