head to head · open source
typeorm vs knex
typeorm has 36,661 GitHub stars, 6,691 forks, 646 open issues and last shipped 7 days ago. knex has 20,339 stars, 2,234 forks, 751 open issues and last shipped 4 months ago. typeorm leads on adoption by 80% (36,661 vs 20,339 stars). typeorm is written in TypeScript under MIT; knex is written in JavaScript under MIT. typeorm has attracted 18% as many forks as stars, knex 11%. typeorm was the more recently maintained of the two, and both are self-hostable with no licence fee. The two share 3 topic tags (javascript, mysql, postgresql), so they are genuine substitutes rather than adjacent tools.
Two open source projects, one decision. Both are free and self-hostable — the differences are community size, license terms, language stack and release pace.
← all 20902 open source comparisons
Side by side
| typeorm | knex | |
|---|---|---|
| GitHub stars | ★ 37K | ★ 20K |
| License | MIT | MIT |
| Written in | TypeScript | JavaScript |
| Last push | 2026-10-29 | 2026-06-26 |
| Forks | ⑂ 6.7K | ⑂ 2.2K |
| Self-hosting | Yes | Yes |
| Data ownership | Your server | Your server |
pick typeorm if
- You weight community size — 37K stars and counting
- You want the MIT license terms
- Your stack matches TypeScript
- You value the larger contributor base for long-term maintenance
pick knex if
- You want the knex feature set and don't need the biggest community
- You prefer the MIT license terms
- Your stack matches JavaScript
- You evaluated both and knex fits your workflow better
About typeorm
TypeORM is an ORM that can run in Node.js, Browser, Cordova, Ionic, React Native, NativeScript, Expo, and Electron platforms and can be used with TypeScript and JavaScript (ES2023). Its goal is to always support the latest JavaScript features and provide additional features that help you to develop any kind of application that uses databases from small applications with a few tables to large scale enterprise applications with multiple databases. TypeORM supports more databases than any other JS/TS ORM: Google Spanner, Microsoft SqlServer, MySQL/MariaDB, MongoDB, Oracle, Postgres, SAP HANA and SQLite, as well as…
read the full typeorm overview →
About knex
knex.js A SQL query builder that is flexible , portable , and fun to use! A batteries included, multi dialect (PostgreSQL, MariaDB, MySQL, CockroachDB, MSSQL, SQLite3, Oracle (including Oracle Wallet Authentication)) query builder for Node.js, featuring: transactions connection pooling streaming queries both a promise and callback API a thorough test suite Node.js versions 16+ are supported. Take a look at the full documentation to get started! Browse the list of plugins and tools built for knex Check out our recipes wiki to search for solutions to some specific problems In case of upgrading from an older…
More in Infrastructure & Operations
Related comparisons
More Databases projects
Compare either of these against the rest of the Databases field.
Frequently asked questions
Is typeorm or knex more popular?
typeorm has 36,661 GitHub stars and knex has 20,339. typeorm has the larger community by that measure.
Are typeorm and knex free?
Both are open source. typeorm is licensed under MIT and knex under MIT. Neither carries a licence fee.
What is the difference between typeorm and knex?
typeorm is written in TypeScript and knex in JavaScript. The practical differences are community size, licence terms, language stack and release cadence — all compared in the table above.
Which should I choose, typeorm or knex?
Choose typeorm if you want the larger community (36,661 stars) or its MIT licence terms. Choose knex if its feature set, stack or MIT licence fits better. Both are self-hostable.