type-fest
Backend / API library · Free
A collection of TypeScript utility types: it expresses complex model and public API constraints without repeating your own type-level code.
Also known as: sindresorhus/type-fest; typescript-types

What you can use for free
Utility types in a TypeScript project under MIT or CC0.
Paid features and costs
Hosting and external services are not part of the type library.
Access and limitations
Utility types in a TypeScript project under MIT or CC0. Hosting and external services are not part of the type library.
Use cases
- Define a TypeScript public API constraint
- Connect a type transformation to compile-time examples of valid/invalid input
Example workflow
A possible workflow; this is not a report of hands-on testing.
Define a TypeScript public API constraint.
Before you start
- A data contract or HTTP workflow.
- A project with a supported runtime.
Steps
- Choose a utility type for a real data structure.
- Connect a type transformation to compile-time examples of valid/invalid input.
- Add error handling and an integration check of the result.
Check your result
- Invalid and missing data are handled predictably.
- Types and the actual response agree; errors are not hidden.
Choosing type-fest
Define a TypeScript public API constraint
Choose this when
- Define a TypeScript public API constraint
- Connect a type transformation to compile-time examples of valid/invalid input
Requirements
- The development branch README specifies TypeScript ≥5.9, ESM, and strict: true in tsconfig, installed through npm install type-fest.
Things to consider
- Costs and limits of free use: Hosting and external services are not part of the type library.
- Terms of use: MIT OR CC0-1.0 at the user's choice.
- The README describes the current development branch and separately links to published-version documentation. Do not automatically apply its requirements to every older version.
Frequently asked questions
What can you use for free in type-fest?
Utility types in a TypeScript project under MIT or CC0.
What additional costs might arise with type-fest?
Hosting and external services are not part of the type library.
What terms of use matter for type-fest?
MIT OR CC0-1.0 at the user's choice.
How do you get started with type-fest?
Choose a utility type for a real data structure. Connect a type transformation to compile-time examples of valid/invalid input. Add error handling and an integration check of the result.
Is type-fest needed for runtime object processing?
Type-fest provides types: Except excludes keys, Merge combines types with priority for the second object, and RequireExactlyOne requires exactly one selected key. The README suggests runtime functions in separate ts-extras.
License
MIT OR CC0-1.0 at the user's choice.
MIT — permissive license
You can use, modify, distribute, and sell the code, including in a closed-source commercial product. When sharing copies or substantial portions of the code, retain the license text and copyright notice. You do not need to open-source your entire project; the author provides no warranties.
License termsCC0 — copyright waiver within permitted limits
You can copy, modify, and use the material commercially without mandatory attribution. CC0 provides a waiver and fallback permission where a full waiver is not possible. It does not automatically grant rights to trademarks, patents, depicted people, or third-party material.
License termsTechnologies and topics
- type-fest
- API
- Development