GitHunt
EC

ecaroth/typesaurus

๐Ÿฆ• Type-safe TypeScript-first ODM for Firestore

๐ŸŽ‰๏ธ NEW: Typesaurus X is out!

๐Ÿฆ• Typesaurus

TypeScript-first ODM for Firestore.

Looking for React adaptor? Check Typesaurus React!

Why?

  • Designed with TypeScript's type inference in mind
  • Universal code (browser & Node.js)
  • Uncompromised type-safety
  • Code autocomplete
  • Say goodbye to any!
  • Say goodbye to exceptions!
  • Ready to start? Follow this guide.

Installation

The library is available as an npm package.
To install Typesaurus, run:

npm install --save typesaurus firebase firebase-admin

Note that Typesaurus requires the firebase package to work in the web environment and firebase-admin to work in Node.js. These packages aren't listed as dependencies, so they won't install automatically with the Typesaurus package.

Features

  • Complete type-safety: uncompromised type-safety, includes Firestore quirks.
  • Universal package: reuse the same code on the client and server.
  • JavaScript-native: converts Firestore data types, i.e. timestamp, to native JS types, i.e. Date.
  • Build size-efficiency: optimized build-size for web.
  • Typed ids: all document ids are types, so you'll never mix up a user id with an account id.
  • Centralized schema: easy to define, read and update.
  • Single-import principle: single import to define, single import to use.

Changelog

See the changelog.

License

MIT ยฉ Sasha Koss

Languages

TypeScript92.2%JavaScript7.5%Makefile0.2%
Created August 22, 2024
Updated August 20, 2025
ecaroth/typesaurus | GitHunt