# type-fest — card for AI agents

Collection of essential TypeScript utility types for common patterns.

Category: Languages, types and runtimes · npm package `type-fest` · latest version 5.10.0 (checked 2026-11-01)
Install: `npm install type-fest`
License: (MIT OR CC0-1.0) (permissive)

In your own product (generator, app, hosted service): **yes**. Permissive license: ship it inside your own product, closed or open source, and keep its license and copyright notice.

## Numbers (AgentGid data)
- Gid Score: 72.9 (#279 of all tools, 6 of 70 in its category)
- Used in 33 public projects set up for AI coding agents (0.5%)
- Downloads last week: 549,251,093 (as of 2026-11-24), +39.1% over 4 weeks
- GitHub stars: 17,554 (as of 2026-11-24)
- Last push: 2026-11-19

## Often used with
Vitest 69.7%, tsx 57.6%, semver (JavaScript) 48.5%, TypeScript 100.0%, Zod 66.7%, uuid 36.4%

## Links
- AgentGid page: https://agentgid.com/tools/type-fest/
- Homepage: https://github.com/sindresorhus/type-fest#readme
- Repository: https://github.com/sindresorhus/type-fest


## type-fest: ready-made TypeScript types for common data shapes

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.

### Where to use 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.

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

```
npm install type-fest
```

- 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}
```


### License
Free to use in any product, paid or not. You may pick MIT or CC0-1.0, and the README says you can copy single types into your code with no credit.

### Good to know
- It is for TypeScript projects only. Version 5 needs TypeScript 5.9 or newer, ES modules and strict mode turned on.
- It contains only type files, no code that runs. Nothing from it reaches your visitors' browsers.
- The README on the main branch describes the next, unreleased version. For the installed 5.10.0, read the docs at its own release.
- Version 5.10.0 came out on 2026-09-17; version 5.0.0 switched to ES modules only and renamed some types.

Checked 2026-11-10 against: https://github.com/sindresorhus/type-fest/blob/v5.10.0/readme.md, https://github.com/sindresorhus/type-fest/blob/v5.10.0/package.json, https://github.com/sindresorhus/type-fest/blob/main/readme.md, https://github.com/sindresorhus/type-fest/blob/main/package.json, https://github.com/sindresorhus/type-fest/blob/main/license-mit, https://github.com/sindresorhus/type-fest/blob/main/license-cc0, https://github.com/sindresorhus/type-fest/releases/tag/v5.0.0, https://github.com/sindresorhus/type-fest/releases/tag/v5.10.0, https://registry.npmjs.org/type-fest

### Mistakes to avoid
- Don't: import {Except} from 'type-fest' → Do: 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.)
- Don't: Installing type-fest 5 in a project on TypeScript below 5.9 or on CommonJS → Do: 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.)
- Don't: Using type-fest with "strict": false in tsconfig → Do: Turn on "strict": true (The types are only supported in strict mode.)
- Don't: StringKeyOf<T> or Opaque<T, Tag> from older guides → Do: KeyAsString<T> and Tagged<T, Tag> (StringKeyOf was renamed in 5.0.0, and the README points Opaque to Tagged.)
- Don't: Copying requirements from the main-branch README (TypeScript >=6, exactOptionalPropertyTypes) for 5.10.0 → Do: 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.

---
AgentGid's catalog is curated: every entry was checked against the maker's official pages (registry, repository, license and pricing pages) on the date shown; a license value shows the quote it stands on wherever AgentGid has one. Usage numbers come from AgentGid's own scan of public repositories set up for AI coding agents. Claims by makers are reported, not tested by AgentGid.
