Packages

ts-morph

28.0.0 · 12 Apr 2026MIT46.3M / weekRepositoryHomepagenpmAtom feed

Your version

10.0.0

major24 Feb 2021Where it was published

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 NamespaceDeclaration is ModuleDeclaration. You will need to rename anything that references "Namespace" and change it to "Module".

  • Breaking

    The ExportedDeclarations union type now properly includes SourceFile. 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 libFolderPath in the Project constructor'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.

  • ExportedDeclarations should include SourceFile and 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 NamespaceDeclaration is ModuleDeclaration. You will need to rename anything that references "Namespace" and change it to "Module".

  • Breaking

    The ExportedDeclarations union type now properly includes SourceFile. 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 libFolderPath in the Project constructor'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.