ts-node
10.9.2 · 8 Dec 2023MIT60.2M / weekRepositoryHomepagenpmAtom feed
10.9.2 is the newest release of 10.x.
In short
3 new4 fixed6 changed
Release note
Questions about this release? Ask in the official discussion thread
Added
Declare types for node builtin modules within REPL so you do not need to import them (#1424, #1500)
Node REPL exposes builtin modules as globals; typechecker now understands this
Typechecking should no longer raise errors when using builtins without first importing
For example:
util.promisify(setTimeout)(1000)orfs.readFileSync('example.txt')
Add
createEsmHooks()function to create ESM loader hooks (API docs)Can be used to compose our loader hooks with another loader or additional logic
register()accepts a ts-nodeService(API docs)register(options)is still supported; no breaking changes
Add support for Node.js's new loader hooks API (#1372, #1457, #1007)
Node.js has changed their loader hooks API
ts-node is compatible with all node versions, detects your node version and exposes the correct hooks API
Node's new API currently only available in node v17 nightly builds
Node will eventually backport the changes to node 16, and may also be backport to 14 and 12
Changed
When ts-node is registered and other libraries
require('source-map-support'), they will be redirected to@cspotcode/source-map-supportSee complete description in Fixed section below
Fixed
Fix #1440, #1441, #1438, #1495: Incorrect stack traces when third-party libraries use
source-map-supportinstead of@cspotcode/source-map-support(#1440, #1441, #1438, #1495, cspotcode/node-source-map-support#23, #1496, #1497)When ts-node is registered and other libraries
require('source-map-support'), they will be redirected to@cspotcode/source-map-supportts-node uses
@cspotcode/source-map-supportfor the fixes and enhancements listed here:@cspotcode/source-map-supportchangelogTo ensure correct stack traces, all libraries must share a compatible sourcemap support implementation
Fix #1363: REPL may erroneously combine previous input with next input, eval both as a single statement (#1363, #1480)
For example, entering
100on first line and* 2on second line would erronously be interpreted as100 * 2REPL now ensures both lines are separate statements, both when typechecking and when evaluating
Fix #1488: Node may log "circular dependency" warning when using
allowJs(#1488, #1489)Fix #1301: Filter empty strings from
TS_NODE_IGNOREandTS_NODE_IGNORE_DIAGNOSTICS; treat empty environment variable as empty array (#1301, #1483)TS_NODE_IGNORE= ts-node ./example.tswill disable default ignore rules; will compile files in./node_modules
Docs
Update VSCode debug configuration (Docs)
Update ESM-related messaging to clarify that experimental status is due to Node.js, not ts-node
Refer to ts-node consistently