Skip to content
Agents tracked: 506 Releases (7d): 634 Agent status: 3 with issuesSince last limit reset: Claude 15d · Codex 0d For AI agents: Markdown Updated Nov 26, 2026

type-fest

Ready-made TypeScript types for common data shapes.

Languages, types and runtimesNPM

GitHubWebsite

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.json

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

73 / 100
Gid Score, #279 overall
549M
downloads a week, npm
17.6K
GitHub stars
33
agent projects use it
type-fest: downloads per weeknpm, type-fest 549,251,093
type-fest: GitHub starssindresorhus/type-fest 17,554

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

27 projects, 0.8%
16 projects, 0.5%
14 projects, 0.6%

Often used with

In 69.7% of its projects
In 57.6% of its projects
In 48.5% of its projects
In 100.0% of its projects
In 66.7% of its projects
In 36.4% of its projects
In 36.4% of its projects
In 36.4% of its projects

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

See all

More in Languages, types and runtimes

Alternatives

type-fest This page

(MIT OR CC0-1.0)Gid 73549M/wk

TypeScript

Pick TypeScript's own built-in helpers (Partial, Omit, Pick, Readonly) when you only need shallow, one-level changes.

Zod

Pick Zod when the data also has to be checked while the app runs, for example form input or answers from a server.

Compare type-fest with another tool

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.”

  1. Add type-fest to a TypeScript project that uses ES modules and strict mode.

    npm install type-fest

    From github.com/sindresorhus/type-fest/blob/v5.10.0/readme.md

  2. 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

import {Except} from 'type-fest'
import type {Except} from 'type-fest'

The package ships only types; in our run with verbatimModuleSyntax the plain import gave TS1484 for every imported name.

Installing type-fest 5 in a project on TypeScript below 5.9 or on CommonJS
Upgrade to TypeScript 5.9+ with ES modules, or stay on type-fest 4.41.0, the last 4.x release

5.0.0 made the package ESM-only and raised the TypeScript minimum.

Using type-fest with "strict": false in tsconfig
Turn on "strict": true

The types are only supported in strict mode.

StringKeyOf<T> or Opaque<T, Tag> from older guides
KeyAsString<T> and Tagged<T, Tag>

StringKeyOf was renamed in 5.0.0, and the README points Opaque to Tagged.

Copying requirements from the main-branch README (TypeScript >=6, exactOptionalPropertyTypes) for 5.10.0
Read the README of the version you install (v5.10.0 needs TypeScript 5.9+ and strict)

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.