Adding type safety to object IDs in TypeScript

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Sevalla - Deploy and host your apps and databases, now with $50 credit!
Sevalla is the PaaS you have been looking for! Advanced deployment pipelines, usage-based pricing, preview apps, templates, human support by developers, and much more!
sevalla.com
featured
InfluxDB – Built for High-Performance Time Series Workloads
InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.
www.influxdata.com
featured
  1. type-fest

    A collection of essential TypeScript types

    Related: https://github.com/sindresorhus/type-fest/blob/main/source/o...

  2. Sevalla

    Deploy and host your apps and databases, now with $50 credit! Sevalla is the PaaS you have been looking for! Advanced deployment pipelines, usage-based pricing, preview apps, templates, human support by developers, and much more!

    Sevalla logo
  3. typeid-js

    TypeScript implementation of TypeIDs: type-safe, K-sortable, and globally unique identifiers inspired by Stripe IDs

    If you want a type-prefixed UUIDv7 type, I can wholeheartedly recommend TypeID-JS: https://github.com/jetpack-io/typeid-js

    Also available for a whole bunch of other languages: https://github.com/jetpack-io/typeid

    UUIDv7 is UUIDv4-compatible (i.e. you can put a v7 UUID anywhere a v4 UUID would go, like in Postgres's UUID datatype) and is time-series sortable, so you don't lose that nice lil' benefit of auto-incrementing IDs.

    And if you use something like TypeORM to define your entities, you can use a Transformer to save as plain UUIDv7 in the DB (so you can use UUID datatypes, not strings), but deal with them as type-prefixed strings everywhere else:

    ```

  4. typeid

    Type-safe, K-sortable, globally unique identifier inspired by Stripe IDs

    If you want a type-prefixed UUIDv7 type, I can wholeheartedly recommend TypeID-JS: https://github.com/jetpack-io/typeid-js

    Also available for a whole bunch of other languages: https://github.com/jetpack-io/typeid

    UUIDv7 is UUIDv4-compatible (i.e. you can put a v7 UUID anywhere a v4 UUID would go, like in Postgres's UUID datatype) and is time-series sortable, so you don't lose that nice lil' benefit of auto-incrementing IDs.

    And if you use something like TypeORM to define your entities, you can use a Transformer to save as plain UUIDv7 in the DB (so you can use UUID datatypes, not strings), but deal with them as type-prefixed strings everywhere else:

    ```

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • A collection of essential TypeScript types

    1 project | news.ycombinator.com | 30 Nov 2024
  • Boost Your JavaScript with JSDoc Typing

    5 projects | dev.to | 8 Apr 2023
  • Essential Code Organization Principles

    2 projects | dev.to | 22 Mar 2023
  • Best practice for typing server data for get vs post in client code

    1 project | /r/typescript | 20 Mar 2023
  • Question on how to handle an object that can have different states and avoid assertions.

    1 project | /r/typescript | 22 Jan 2023

Did you know that TypeScript is
the 1st most popular programming language
based on number of references?