Transpiles TypeScript files to JavaScript and executes them.
npx exec-ts ./your-ts-file.ts
-
--require module
Preload the specified module at startup before executing the script. Similar to node's--require
flag. Useful in combination with tsconfig-paths to support aliases in your TypeScript scripts. Can be specified multiple times to preload multiple modules.--require module-a --require module-b
-
--project ./path/to/tsconfig.json
Specify path totsconfig.json
file. Default behavior is to discover the closesttsconfig.json
file starting from the folder of the executed file traversing up.
You need to use --
before passing arguments to the TS file.
npx exec-ts ./your-ts-file.ts -- --your-arg=is-valid
Arguments before --
are parsed by exec-ts
itself.