https://github.com/rebeccastevens/type-to-string
Get a string representation of a TypeScript type.
https://github.com/rebeccastevens/type-to-string
Last synced: 5 months ago
JSON representation
Get a string representation of a TypeScript type.
- Host: GitHub
- URL: https://github.com/rebeccastevens/type-to-string
- Owner: RebeccaStevens
- License: bsd-3-clause
- Created: 2024-04-01T22:52:34.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-05T11:42:08.000Z (5 months ago)
- Last Synced: 2025-01-05T12:28:33.225Z (5 months ago)
- Language: TypeScript
- Size: 171 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 29
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# 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)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
```