type-fest
Ready-made TypeScript types for common data shapes.
1. License
“"license": "(MIT OR CC0-1.0)",”
Use it under MIT or CC0-1.0, your choice; CC0 asks for nothing.
github.com/sindresorhus/type-fest/blob/v5.10.0/package.json3. Used by agents' projects
Dependency in 33 public GitHub projects set up for AI coding agents that we scanned (0.5%).
4. Agent access
Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.
From the package registry and GitHub, checked daily; card checked Nov 10, 2026. Tap a verdict to see its source.How we checkedReport an error
What type-fest does
type-fest is a free collection of ready-made TypeScript types, short rules that describe what your data must look like. Your code editor then catches mistakes such as sending a password field out or forgetting a required contact field, before the app runs. It only helps while code is written and adds nothing to what visitors download.
What people build with it
Send user data without the password
Describe the user record your server may send out as "the user, minus the password", so the editor flags any code that leaks it.
New records before the database sets the id
A sign-up form builds a user without an id, and the type still demands every other field.
Save only the settings that changed
A settings page sends just the switches the person touched, even deep inside nested groups, and the type still checks their names.
Ask for an email or a phone
A contact form must get at least one way to reach the person; an empty contact is refused while you write the code.
Lock shared settings against edits
Mark a loaded configuration as read-only all the way down, so no part of the app can change it by mistake.
Plan names with suggestions
Your editor suggests the known plan names, like free and pro, but still accepts a new name a partner sends.
type-fest popularity
Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated
How type-fest is used
- type-fest is a dependency in 33 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (0.7% of the 4,867 JavaScript/TypeScript ones), #11 of 70 in languages, types and runtimes.
- Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 99; those are left out of every share on this page.
- Projects that use it most often also use Vitest (69.7%), tsx (57.6%), semver (JavaScript) (48.5%).
By coding agent
Often used with
More about type-fest
Funding
- GitHub Sponsors: https://github.com/sindresorhus
- GitHub Sponsors: https://github.com/som-sm
- GitHub Sponsors: https://github.com/Emiyaaaaa
- GitHub Sponsors: https://github.com/voxpelli
- 186 GitHub sponsors
More in Languages, types and runtimes
Alternatives
type-fest This page
Pick TypeScript's own built-in helpers (Partial, Omit, Pick, Readonly) when you only need shallow, one-level changes.
Pick Zod when the data also has to be checked while the app runs, for example form input or answers from a server.
Get started
Tell your AI assistant
“Use the npm package type-fest (pin type-fest@5.10.0, TypeScript 5.9+, ESM, strict true) with import type only, and build our types with Except, SetOptional, PartialDeep and RequireAtLeastOne instead of hand-written copies.”
Add type-fest to a TypeScript project that uses ES modules and strict mode.
npm install type-festFrom github.com/sindresorhus/type-fest/blob/v5.10.0/readme.md
Import the types you need with import type and build your own types from them.
import type {Except} from 'type-fest'; type Foo = { unicorn: string; rainbow: boolean; }; type FooWithoutRainbow = Except<Foo, 'rainbow'>; //=> {unicorn: string}From github.com/sindresorhus/type-fest/blob/v5.10.0/readme.md
Mistakes to avoid
The package ships only types; in our run with verbatimModuleSyntax the plain import gave TS1484 for every imported name.
5.0.0 made the package ESM-only and raised the TypeScript minimum.
The types are only supported in strict mode.
StringKeyOf was renamed in 5.0.0, and the README points Opaque to Tagged.
The main-branch README describes the unreleased development version.
Questions
Does it make my app bigger?
No. The package has only type files, so nothing is bundled into the app.
Can I copy one type instead of installing the whole package?
Yes, the README allows copying the types you need, with no credit required.
Does it check data while the app runs?
No. TypeScript types only exist while you write and build code; for checks at run time use a validator such as Zod.
I know a type as Opaque, Branded or PartialBy. Is it there?
Yes, under another name. The README lists Tagged for Opaque and Branded, and SetOptional for PartialBy.