ts-node
10.9.2 · 8 Dec 2023MIT60.2M / weekRepositoryHomepagenpmAtom feed
10.9.2 is the newest release of 10.x.
In short
7 breaking2 deprecated7 new3 fixed3 changed
- breaking
Breaking changes are prefixed with [BREAKING]
- breaking
**** Make
--script-modedefault behavior; resolve tsconfig relative to entrypoint script instead of cwd (#949, #1197, #1155) - breaking
****
ignorerules evaluate relative totsconfig.jsondirectory, otherwisecwd - breaking
**** Remove support for node 10. Minimum supported version is node 12
- breaking
**** Internal APIs removed from type declarations
- breaking
**** Fix #1229 and #1235: always throw
ERR_REQUIRE_ESMwhen attempting to execute ESM as CJS, even when not using--loader ts-node/esm - breaking
**** Fix #1225:
compileris loaded relative totsconfig.jsoninstead of entrypoint script - deprecated
Deprecate
TS_NODE_SCOPE
Release note
Questions about this release? Ask in the official discussion thread
Breaking changes are prefixed with [BREAKING]
Added
Adds
--show-configto log the resolved configuration (docs) (#1100, #1243)Bundle and re-export @tsconfig/node* configurations for convenience (docs) (#1202, #1236, #1313)
Default to appropriate @tsconfig/node* configuration based on node and typescript versions (docs) (#1202, #1236, #1313)
Automatically reference @types/node; use globally-installed @types/node if not locally installed (#1240, #1257)
Add
swcintegration and new--transpileroption to use third-party transpilers for a massive speed boost on large codebases (docs) (#779, #1160)Add
scopeDirAPI option (docs)Add
projectSearchDirAPI option (docs)Add
--cwd-modeandts-node-cwdto resolve config file relative to cwd, not entrypoint script
Changed
- breaking
**** Make
--script-modedefault behavior; resolve tsconfig relative to entrypoint script instead of cwd (#949, #1197, #1155)In most cases this change will have no noticeable effect
Primarily benefits portable shell scripts on your
$PATH, becausets-nodewill respect the script's localtsconfig.jsonUse
--cwd-modeorts-node-cwdif you need legacy behavior
- breaking
****
ignorerules evaluate relative totsconfig.jsondirectory, otherwisecwd - breaking
**** Remove support for node 10. Minimum supported version is node 12
Rename
--dirto--cwd; renameTS_NODE_DIRtoTS_NODE_CWD--dirandTS_NODE_DIRare deprecated but still parsed for backwards-compatibility--direffectively changed the working directory ofts-node; renaming makes this behavior more obvious
Deprecated
- deprecated
Deprecate
TS_NODE_SCOPE - deprecated
Deprecate
--dirandTS_NODE_DIR
Removed
- breaking
**** Internal APIs removed from type declarations
Removed
DEFAULTS,normalizeSlashes,parse,splitNo features were removed
This will only affect consumers of
ts-node's programmatic API
Fixed
- breaking
**** Fix #1229 and #1235: always throw
ERR_REQUIRE_ESMwhen attempting to execute ESM as CJS, even when not using--loader ts-node/esmThis aligns our behavior with vanilla
node
- breaking
**** Fix #1225:
compileris loaded relative totsconfig.jsoninstead of entrypoint scriptIn most cases this change will have no noticable effect
Fix #1217: REPL not always using passed stdout and stderr
Fix #1220:
ts-node ./indexmay execute the wrong file extension because tsconfig search poisons therequire.resolvecacheFix #1322: Sourcemaps fail for filenames with spaces or other characters which are percent-encoded in URLs (#1160, #1330)
Fix #1331: Resolution of node builtin modules in ESM loader fails on node >=12.20.0, <13
Docs
New documentation website: typestrong.org/ts-node
README is generated to match the website
Added page explaining CommonJS vs ESM
Added page with Performance advice
Added Troubleshooting page
Organized and added to "Recipes" section with third-party tool integrations
Added TypeDoc-generated API docs
Work was spread across multiple tickets
Thanks to these contributors for PRs which improved our documentation
add troubleshooting tip for syntax errors
Clarify handling of tsx/jsx file extensions
Added
CONTRIBUTING.mdto document the codebase and our development workflow