Open-source project
typeorm/typeorm avatar
typeorm/typeorm

TypeORM: Active Record and Data Mapper in one decorator-based ORM for Node.js and beyond

TypeScript & JavaScript ORM for Node.js — supports PostgreSQL, MySQL, MariaDB, SQLite, SQL Server, Oracle, and more.

36,672 stars6,695 forksTypeScriptMIT

At a glance

What is it?
TypeORM is a TypeScript and JavaScript ORM that supports both Active Record and Data Mapper, spans a long list of SQL databases plus MongoDB, and runs on Node.js, browsers and mobile runtimes. This guide covers how the two patterns differ in code, what the repository's own tooling and release record say, and where you need to read the driver docs yourself.
Who is it for?
TypeORM suits teams that want decorator-defined entities in TypeScript, a choice between Active Record and Data Mapper, and one ORM across many database engines. It is a weaker fit if you expect the README to settle per-database behavior, since each driver has its own page under docs/docs/drivers.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 1 day ago.
What is it written in?
Mainly TypeScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • typeorm/typeorm36,672 ★ · +41
Star history
Repository2026-08-182026-11-15
typeorm/typeorm36.6k36.7k

41 Stars in the last 89 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

Active Record and Data Mapper share the same entity decorators

TypeORM lets you choose between two styles on top of the same decorators. In the Data Mapper style the entity is a plain class marked with Entity, PrimaryGeneratedColumn and Column, and all persistence goes through a repository obtained from a data source.

typescript
import { Entity, PrimaryGeneratedColumn, Column } from "typeorm"

@Entity()
export class User {
    @PrimaryGeneratedColumn()
    id: number

    @Column()
    firstName: string

    @Column()
    lastName: string

    @Column()
    age: number
}

The repository then handles saving, finding and removing.

typescript
const userRepository = MyDataSource.getRepository(User)

const user = new User()
user.firstName = "Timber"
user.lastName = "Saw"
user.age = 25
await userRepository.save(user)

const allUsers = await userRepository.find()
const firstUser = await userRepository.findOneBy({
    id: 1,
}) // find by id
const timber = await userRepository.findOneBy({
    firstName: "Timber",
    lastName: "Saw",
}) // find by firstName and lastName

await userRepository.remove(timber)

The Active Record style extends BaseEntity, so the entity itself gains save, find, findOneBy and remove. You pick one per entity, and mixing them in a single codebase means two ways of reading the same model.

The Active Record form puts persistence calls on the class itself

With BaseEntity the same operations become static and instance methods, so no repository lookup is needed at the call site.

typescript
const user = new User()
user.firstName = "Timber"
user.lastName = "Saw"
user.age = 25
await user.save()

const allUsers = await User.find()
const firstUser = await User.findOneBy({
    id: 1,
})
const timber = await User.findOneBy({
    firstName: "Timber",
    lastName: "Saw",
})

await timber.remove()

The trade is coupling. Active Record is shorter, but entities now know how to talk to the database, which makes them harder to use in code that should not depend on a data source. Data Mapper keeps entities as plain data and moves the database knowledge into repositories. The README ties its claim of loosely coupled, maintainable applications to being able to use either, and the guide on this choice lives at docs/docs/guides/1-active-record-data-mapper.md.

Database coverage is wide, but each engine has its own driver page

The README names Google Spanner, Microsoft SQL Server, MySQL and MariaDB, MongoDB, Oracle, Postgres, SAP HANA and SQLite, along with derived databases and different drivers. The feature list adds CockroachDB and sql.js, and describes MongoDB as the NoSQL option.

Every one of those has a separate document under docs/docs/drivers, such as postgres.md, oracle.md and sap.md. That split matters because the shared feature list covers cross-database and cross-schema queries, replication, connection pooling and query caching, and the README cannot tell you which of those a given engine supports in the way you expect. Read the page for your driver before you design around a feature.

The workspace file shows another consequence. Its pnpm configuration allows build scripts only for better-sqlite3 and ignores them for @sap/hana-client, cpu-features, libpq, oracledb, protobufjs and ssh2. Contributors working on the repository therefore do not get those native builds compiled by default.

One ORM across Node.js, browsers and mobile runtimes, with samples that live elsewhere

TypeORM is described as running on Node.js, Browser, Cordova, Ionic, React Native, NativeScript, Expo and Electron, with TypeScript and JavaScript at the ES2023 level and both ESM and CommonJS support. Its stated aim is to always support the latest JavaScript features.

The sample list is long: TypeScript, JavaScript, JavaScript with Babel, a browser example with SystemJS, Express, Koa, MongoDB, Cordova, Ionic, React Native, NativeScript-Vue and Electron in both JavaScript and TypeScript. Most sit in the typeorm GitHub organization. Two do not. The React browser example is at ItayGarin/typeorm-react-swc, and the NativeScript-Angular one is at betov18x.

The practical limit is that samples are separate repositories with their own dependency versions. A sample that compiled against an older release may not match the 1.1.x line, so treat it as a layout guide and check its package.json against the version you install.

The monorepo needs pnpm 10 and a narrow range of Node versions

The repository root is a private workspace called typeorm-monorepo at version 1.1.2, and it pins [email protected] in packageManager. A devEngines block makes a wrong package manager an error through onFail. The engines field accepts Node ^20.19.0, ^22.13.0 or >=24.11.0, so Node 21 and 23 are outside the supported range.

The root scripts delegate to the typeorm package with pnpm filters: compile, package, test, test:fast, typecheck and watch. Others cover linting across all packages, Prettier formatting with a check variant for CI, a changelog generated by standard-changelog, and check:manifests, which runs scripts/check-publishable-manifests.mjs. docs:dev starts the documentation site from the docs directory. Husky runs on prepare, with lint-staged alongside.

If you only consume TypeORM from npm, none of this applies. If you plan to send a pull request, install pnpm first, because the repository will refuse another package manager.

The test compose file runs two MySQL services on the same host port

The docker-compose.yml in the repository exists to run databases for the test suite. Services include mysql-5 on image mysql:5.7.44, mysql-9, mariadb-10 on mariadb:10.11.19, mariadb-12 on mariadb:12.3.3, and Postgres 14 and 17 images from ghcr.io/typeorm/docker that bundle PostGIS and pgvector. Credentials are plain test values such as username, password and admin, so these are throwaway containers, not a template for production.

Both MySQL services publish host port 3306, and both MariaDB services publish host port 3307. Starting mysql-5 and mysql-9 together would collide on the host, so you bring up one version at a time. A comment in the Postgres entries says that if you need extensions beyond PostGIS, it is probably time to create a purpose-built image.

This tells you which engines and versions the maintainers test against locally, but it is a test fixture, so confirm your production version against the driver documentation.

Release history shows a 1.1 line with three tags between July and October

The repository is not archived, uses the MIT license and has master as its default branch. Its last push was on 29 October 2026. Recent releases are 1.1.0 on 13 July, 1.1.1 on 1 September and 1.1.2 on 8 October 2026, each separated by roughly one to two months.

That cadence suggests you can expect fixes in patch releases rather than weekly drops. It also means that between tags the master branch moves ahead, and the docs at typeorm.io describe whatever is current. When a behavior in the docs does not match your installed version, compare against the tag you actually have.

The feature list also includes claims such as following all possible best practices and producing performant, clean code. Those are the project's own description and not something the repository metadata can confirm, so judge them against your own queries, migrations and pagination with joins.

Editorial conclusion

TypeORM suits teams that want decorator-defined entities in TypeScript, a choice between Active Record and Data Mapper, and one ORM across many database engines. It is a weaker fit if you expect the README to settle per-database behavior, since each driver has its own page under docs/docs/drivers. Pin to a 1.1.x release, read the driver page for your database, and run your migrations against a throwaway instance first.

Frequently asked questions

What is TypeORM?

TypeORM is an ORM for TypeScript and JavaScript that runs in Node.js, browsers and several mobile and desktop runtimes. It supports both the Active Record and Data Mapper patterns.

Is TypeORM available on NPM?

Yes. The README links to the typeorm package at npmjs.com/package/typeorm from its badges, and the repository's root package.json is currently at version 1.1.2.

What is TypeORM used for?

It maps classes to database tables so applications can query and save data through entities, repositories and a QueryBuilder. Supported engines include Postgres, MySQL, MariaDB, SQLite, SQL Server, Oracle, SAP HANA, Google Spanner and MongoDB.

What is TypeORM in Node.js?

In Node.js it is the ORM layer that defines entities with decorators and runs queries against a configured data source. It supports ESM and CommonJS, with Node ^20.19.0, ^22.13.0 or >=24.11.0 required to work on the repository.

Official sources

  1. Official documentation
  2. Official README
  3. Project repository
  4. Release notes
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/typeorm-typeorm.svg)](https://hysenlabs.com/projects/typeorm-typeorm)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/typeorm-typeorm.svg)](https://hysenlabs.com/projects/typeorm-typeorm)

Was this useful?