Home

Awesome

<p align="center"> <img src="/logo.png" width="120" alt="ts-essentials"> <h3 align="center">ts-essentials</h3> <p align="center">All essential TypeScript types in one place 馃</p> <p align="center"> <a href="https://www.npmjs.com/package/ts-essentials" title="View this project on NPM"> <img alt="Version" src="https://img.shields.io/npm/v/ts-essentials.svg"> </a> <img alt="Downloads" src="https://img.shields.io/npm/dm/ts-essentials.svg"> <a href="https://github.com/ts-essentials/ts-essentials/actions?query=branch%3Amaster" title="View Github Build status"> <img alt="Build status" src="https://github.com/ts-essentials/ts-essentials/actions/workflows/ci.yml/badge.svg"> </a> <a href="https://t.me/ts_essentials" title="Get support in Telegram"> <img alt="Telegram" src="https://img.shields.io/badge/-telegram-red?color=white&logo=telegram"> </a> <a href="/package.json"><img alt="Software License" src="https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square"></a> <a href="https://codechecks.io"><img src="https://raw.githubusercontent.com/codechecks/docs/master/images/badges/badge-default.svg?sanitize=true" alt="codechecks.io"></a> </p> </p>

Install

npm install --save-dev ts-essentials

馃憠 We require typescript>=4.5. If you're looking for support for older TS versions, please have a look at the TypeScript dependency table

馃憠 As we really want types to be stricter, we require enabled strictNullChecks in your project

API

ts-essentials is a set of high-quality, useful TypeScript types that make writing type-safe code easier.

Basic

Utility types

Mark wrapper types

Deep wrapper types

Key types

Type checkers

Arrays and Tuples

Change case

Function types

Utility functions

鈿狅笍 Make sure you add ts-essentials to your dependencies (npm install --save ts-essentials) to avoid runtime errors

Search

When one of utility types is known by a different name, kindly ask adding it here for the better search.

Built-in types

TypeScript provides several utility types to facilitate common type transformations. These utilities are available globally.

TypeScript dependency table

ts-essentialstypescript / type of dependency
^10.0.0^4.5.0 / peer optional
^9.4.0^4.1.0 / peer optional
^8.0.0^4.1.0 / peer
^5.0.0^3.7.0 / peer
^3.0.1^3.5.0 / peer
^1.0.1^3.2.2 / dev
^1.0.0^3.0.3 / dev

Contributors

Special shout-out to active contributors:

And thanks goes to these wonderful people:

馃捇 - contributions, i.e. links to commits by the user on this project

Contributions of any kind welcome! Read more