// register.js // Copyright (C) 2025 DTP Technologies, LLC // All Rights Reserved /* * Old: node --loader ts-node/esm script.ts * New: node --import ./register.js script.ts * * The new approach is to run this script, which then registers the ESM loader * with Node, then immediately uses it. You can do more in this script, but * that's bad practice. * * Don't perform application setup and initialization in this module. Register * any loaders you'll need, but that's all. */ import { register } from "node:module"; import { pathToFileURL } from "node:url"; // register("./es-import-trace.js", pathToFileURL("./")); register("ts-node/esm", pathToFileURL("./"));