ts-node
10.9.2 · 8 Dec 2023MIT60.2M / weekRepositoryHomepagenpmAtom feed
10.9.2 is the newest release of 10.x.
In short
3 new1 faster4 fixed9 changed
Release note
Questions about this release? Ask in the official discussion thread
Added
Added support for
module=NodeNext,module=Node16,.mts,.cts,.mjs, and.cjsfile extensions (#1414, #1694, #1744, #1745, #1727, #1717, #1753, #1757)For best results, enable
experimentalResolver(docs)See TypeScript's official documentation: typescriptlang.org/docs/handbook/esm-node.html
enables mixed-mode projects with both ESM and CommonJS
enables all supported file extensions in TypeScript 4.7
Obeys package.json "type"
Added ability to include file extensions in CommonJS imports (#1727, #1753)
Enables consistency with ESM, where file extensions are often mandatory
Resolves from emitted to source file extensions (#1727, #1753)
Must enable
experimentalResolver, will be enabled by default in a future version (docs)Typechecker requires importing the emitted file extension; ts-node resolves correctly to the source file. E.g.
import "./foo.js"will executefoo.tsSee also: TypeScript issue #37582If typechecking is disabled, you can also use source file extensions. E.g.
import "./foo.ts"
Added
experimentalSpecifierResolution(#1727, #1753)the same as Node's
--experimental-specifier-resolution(Node docs)can also be specified in
tsconfig.jsonfor convenience, to avoid the CLI flagallows omitting file extensions in ESM imports, plus a few other CommonJS-style conveniences
Adds
diagnosticsproperty toTSError, with array of TypeScript diagnostic objects from the compiler (API docs) (#1705, #1706)
Changed
Renames option
experimentalResolverFeaturestoexperimentalResolver(docs)Internal change to ESM loader for compatibility with forthcoming node versions: returns
shortCircuit: true(#1714, #1715)Performance: Optimize filesystem stat calls in ESM loader and new CommonJS resolver (#1758, #1759)
Performance, maintenance: Upgrade source-mapper dependency "@cspotcode/source-map-support"
Switches to "trace-mapping" for underlying source-map parsing
Fixed
Fixed bug where REPL
.typecommand was not showing any type information when using TypeScript nightly builds (#1761, #1762)Correctly suppress "Custom ESM Loaders" warning on newer node versions where the warning's prose changed
Fixed REPL bug where function signatures could not be entered across multiple lines (#1667, #1677)
REPL treats unparenthesized object literals as objects, instead of as block scopes (#1697, #1699)
Fixed bug where
preferTsExtscombined with third-party transpiler hooks could disruptnyccode coverageFixed bug where
file://URLs in stack traces did not always use percent-encoding (#1738, #1726, #1729)Fixed bug where v8-compile-cache-lib did not correctly unhook itself (#1717, #1718, #1719)
This internal dependency is used to speed up loading the TypeScript compiler
Docs