type-to-string
Version:
Get a string representation of a TypeScript type.
46 lines (31 loc) • 1.87 kB
Markdown
<div align="center">
# Type to String
Get a string representation of a TypeScript type.
[](https://www.npmjs.com/package/type-to-string)
[](https://github.com/RebeccaStevens/type-to-string/actions/workflows/release.yml)
[](https://codecov.io/gh/RebeccaStevens/type-to-string)\
[](https://github.com/prettier/prettier)
[](https://github.com/RebeccaStevens/type-to-string/discussions)
[](https://opensource.org/licenses/BSD-3-Clause)
[](https://commitizen.github.io/cz-cli/)
[](https://github.com/semantic-release/semantic-release)
</div>
This project is really just me playing with different ways to get string representions of TypeScript types.
For most users, you can probably just use TypeScript built in functions:
```ts
checker.typeToString(type);
```
```ts
typeNode.getText();
```
## Donate
[Any donations would be much appreciated](./DONATIONS.md). 😄
## Installation
```sh
# Install with npm
npm install type-to-string
# Install with pnpm
pnpm add type-to-string
# Install with yarn
yarn add type-to-string
```