ts-morph
28.0.0 · 12 Apr 2026MIT46.3M / weekRepositoryHomepagenpmAtom feed
10.1.0 is the newest release of 10.x.
In short
5 breaking6 new2 fixed
- Breaking
Upgraded to TS 4.2 (see TypeScript blog for breaking changes).
- Breaking
ts-morph did not properly support some ambient and all shorthand ambient module declarations. Now
NamespaceDeclarationisModuleDeclaration. You will need to rename anything that references "Namespace" and change it to "Module". - Breaking
The
ExportedDeclarationsunion type now properly includesSourceFile. It previously could have done that anyway and your code might not have handled it. - Breaking
TypeScript is now bundled with ts-morph. You may still access TypeScript via
import { ts } from "ts-morph"as you should have been doing anyway. - Breaking
The lib files/lib.d.ts files are now served from memory regardless of the file system host. If you want the old behaviour, specify a
libFolderPathin theProjectconstructor's options.
Release note
The section about ts-morph of a note shared by several packages.
Bug Fixes
Fix internal root directory check to work on windows.
ExportedDeclarationsshould includeSourceFileand fixed handling of namespace exports.
Features
Type - Add literal related helper properties.
NamespaceDeclaration -> ModuleDeclaration
Add
Node#getFlags().Add isKnownTypesPackageName option
Bundle typescript package in ts-morph/common
Upgrade to TS 4.2
Breaking changes
- Breaking
Upgraded to TS 4.2 (see TypeScript blog for breaking changes).
- Breaking
ts-morph did not properly support some ambient and all shorthand ambient module declarations. Now
NamespaceDeclarationisModuleDeclaration. You will need to rename anything that references "Namespace" and change it to "Module". - Breaking
The
ExportedDeclarationsunion type now properly includesSourceFile. It previously could have done that anyway and your code might not have handled it. - Breaking
TypeScript is now bundled with ts-morph. You may still access TypeScript via
import { ts } from "ts-morph"as you should have been doing anyway. - Breaking
The lib files/lib.d.ts files are now served from memory regardless of the file system host. If you want the old behaviour, specify a
libFolderPathin theProjectconstructor's options.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.