TypeORM

A TypeScript/JavaScript ORM supporting both Active Record and Data Mapper, across more databases than any other JS ORM

Library
npm
v1.1.2
36,661 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
88 /100 Excellent
Development Activity 92
Maintenance 84
Community 76
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
78 /100 Good
Architecture 85
Code Quality 82
Innovation 76
Learning Curve 70

TypeORM is an ORM that runs in Node.js, browsers, Cordova, Ionic, React Native, NativeScript, Expo, and Electron, usable with either TypeScript or modern JavaScript. It supports more databases than any other JS/TS ORM — MySQL/MariaDB, Postgres, CockroachDB, SQLite, Microsoft SQL Server, Oracle, SAP HANA, Google Spanner, and MongoDB — through a common driver architecture.

Unlike most JavaScript ORMs, TypeORM supports both the Active Record and Data Mapper patterns side by side, letting teams choose the style that fits their codebase. It ships with entities/decorators, an entity manager and repositories, a full migration system, connection pooling and replication, a fluent QueryBuilder, and hooks (listeners/subscribers), drawing heavy influence from Hibernate, Doctrine, and Entity Framework.

What You Get

  • A common driver layer spanning MySQL/MariaDB, Postgres, CockroachDB, SQLite, SQL Server, Oracle, SAP HANA, Google Spanner, and MongoDB
  • Both Active Record and Data Mapper patterns, selectable per project rather than locked in by the library
  • Decorator-based entity/column/relation definitions plus an alternative entity-schema (non-decorator) API
  • A CLI for generating and running database migrations, including automatic migration generation from entity diffs
  • A fluent QueryBuilder for complex joins, pagination, and cross-database/cross-schema queries

Common Use Cases

  • Building a Node.js/NestJS backend that needs a full-featured ORM with migrations and relations across a relational database
  • Standardizing data access across a codebase that must support multiple database engines (e.g. Postgres in prod, SQLite in tests)
  • Modeling complex domain relations (eager/lazy, self-referenced, closure-table) that simpler query builders don’t support natively
  • Migrating an existing Active Record-style codebase to TypeORM without switching to a Data Mapper architecture (or vice versa)

Under The Hood

Architecture - the src/ tree separates concerns cleanly: driver/ implements the per-database adapter layer, query-builder/ and query-runner/ handle SQL generation and execution, metadata-builder//metadata-args//metadata/ build the entity/column/relation reflection model from decorators, schema-builder/ derives and applies schema/migrations, and entity-manager//repository/ expose the Data Mapper API while persistence/ backs the Active Record BaseEntity methods. Tech Stack - TypeScript targeting Node.js, browser, and mobile runtimes (Cordova/Ionic/React Native/NativeScript/Expo/Electron), built with gulp, tested via a pnpm workspace, and using Stryker for mutation testing (stryker.config.json) alongside SonarCloud for coverage reporting. Code Quality - the test/ directory contains roughly 2,700 TypeScript test files split into functional, unit, core, and github-issues regression suites, with a docker-compose.yml spinning up real database instances for integration testing rather than relying solely on mocks — a strong signal for an ORM where driver-specific SQL dialect bugs are easy to miss. API Design - decorator-based entities (@Entity, @Column, @OneToMany) keep model definitions declarative and close to the class they describe, while the dual Active Record/Data Mapper support means the public API intentionally offers two idiomatic entry points (entity.save() vs repository.save(entity)) rather than forcing one pattern on all consumers.

Used by 16 apps in this directory

TypeScript
26%
AGPL 3.0

Omnivore

Bookmarks Archiving · Knowledge Management · Note Taking

16,356

Self-hosted read-it-later platform with highlights, newsletters, PDFs, and seamless Obsidian and Logseq integration.

View details
90
Repo Health
74
Technical
65
Dependency
Built with
TypeScript 26%
JavaScript 24%
HTML 20%
Updated 6 days ago
TypeScript
96%
Apache 2.0

OneUptime

Monitoring

7,751

The complete open-source observability platform that replaces PagerDuty, Datadog, Sentry, and StatusPage with a single self-hostable system.

View details
91
Repo Health
81
Technical
65
Dependency
Built with
TypeScript 96%
Updated 5 days ago
TypeScript
90%
MIT

Plasmic

CMS · Design Tools · Low Code Platforms

7,125

The open-source visual builder that lets teams design React apps and websites with drag-and-drop while integrating seamlessly with your codebase.

View details
81
Repo Health
78
Technical
64
Dependency
Built with
TypeScript 90%
Updated 6 days ago
TypeScript
97%
AGPL 3.0

Swetrix

Analytics

1,213

Privacy-first, cookieless web analytics with error tracking, session replays, and performance monitoring — self-host or use Cloud.

View details
87
Repo Health
71
Technical
66
Dependency
Built with
TypeScript 97%
Updated 1 weeks ago
HTML
68%
AGPL 3.0

ToolJet

AI Agents · Low Code Platforms · No Code Platforms

41,123

Open-source AI-native platform to build and deploy internal tools, workflows, and AI agents with a visual drag-and-drop builder and 80+ data source integrations.

View details
94
Repo Health
81
Technical
63
Dependency
Built with
HTML 68%
JavaScript 20%
Updated 5 days ago
TypeScript
79%
MIT

Trench

Analytics · Data Engineering · Monitoring

1,665

Open-source event tracking infrastructure built on Kafka and ClickHouse that handles thousands of events per second on a single node, with full Segment API compatibility and no cookies.

View details
44
Repo Health
81
Technical
73
Dependency
Built with
TypeScript 79%
MDX 15%
Updated 6 months ago
TypeScript
84%
Other

twenty

CRM

59,615

The open-source CRM you build, ship, and version like the rest of your stack — with customizable objects, AI agents, and a TypeScript SDK.

View details
92
Repo Health
82
Technical
64
Dependency
Built with
TypeScript 84%
MDX 14%
Updated 6 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers