Home

Awesome

<div align="center"> <br> <br> <img src="media/logo.svg" alt="type-fest" height="300"> <br> <br> <b>A collection of essential TypeScript types</b> <br> <hr> </div> <br> <br>

Build Status

<!-- Commented out until they actually show anything [![npm dependents](https://badgen.net/npm/dependents/type-fest)](https://www.npmjs.com/package/type-fest?activeTab=dependents) [![npm downloads](https://badgen.net/npm/dt/type-fest)](https://www.npmjs.com/package/type-fest) -->

NOTE: this is a maintained fork for Deno of the original! Go support sindresorhus for creating this project!

Deno Example

import type {Except} from 'https://cdn.jsdelivr.net/gh/denofn/type-fest@latest/mod.ts';

type Foo = {
	unicorn: string;
	rainbow: boolean;
};

type FooWithoutRainbow = Except<Foo, 'rainbow'>;
//=> {unicorn: string}

Many of the types here should have been built-in. You can help by suggesting some of them to the TypeScript project.

Either add this package as a dependency or copy-paste the needed types. No credit required. 👌

PR welcome for additional commonly needed types and docs improvements. Read the contributing guidelines first.

Install

$ npm install type-fest

Requires TypeScript >=3.2

Usage

import {Except} from 'type-fest';

type Foo = {
	unicorn: string;
	rainbow: boolean;
};

type FooWithoutRainbow = Except<Foo, 'rainbow'>;
//=> {unicorn: string}

API

Click the type names for complete docs.

Basic

Utilities

Miscellaneous

Declined types

If we decline a type addition, we will make sure to document the better solution here.

Tips

Built-in types

There are many advanced types most users don't know about.

You can find some examples in the TypeScript docs.

Maintainers

License

(MIT OR CC0-1.0)


<div align="center"> <b> <a href="https://tidelift.com/subscription/pkg/npm-type-fest?utm_source=npm-type-fest&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a> </b> <br> <sub> Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies. </sub> </div>