type-fest
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|
Type-fest is a resourceful, broad, and useful collection of TypeScript types. Many of these types could very easily be regarded as extensions that should've been built-in. Type-fest offers a delightful selection ranging from basic elementary types like Primitive
to utility types such as Writable
. What's more, it even provides types for intricate structures like a PackageJson
file! All of these types come with the goal of simplifying TypeScript programming and making it more structurally efficient and readable. This package is meticulously maintained and regularly updated.
Type-fest can be used by simply installing it via npm with the command npm install type-fest
. Once you've installed the package, you can import the necessary types into your TypeScript files and start using them immediately. For instance, you might import the type Except
and use it to create a new type:
import type {Except} from 'type-fest';
type Foo = {
unicorn: string;
rainbow: boolean;
};
type FooWithoutRainbow = Except<Foo, 'rainbow'>;
// Produced type is: {unicorn: string}
In this snippet, FooWithoutRainbow
is a new type that has all properties of Foo
except for 'rainbow'. It should be noted that, since type-fest only provides TypeScript types, which are removed during compilation, it does not propagate to the final JavaScript that's being shipped. It's just a development utility.
Type-fest's documentation and API reference can be found within the project's GitHub repository. The repository's main README file provides a comprehensive list of