# kind2string

> Utility to ensure extract-react-types output can be rendered without errors

Latest version **0.8.1** (published 2021-01-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install kind2string
pnpm add kind2string
yarn add kind2string
bun add kind2string
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.8.1 |
| Published | 2021-01-28 |
| First published | 2018-02-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 46.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 188 |
| Author | Atlassian |
| Maintainers | noviny, delcore92, gwyneplaine |

## Links

- npm: https://www.npmjs.com/package/kind2string
- Repository: https://github.com/atlassian/extract-react-types
- Homepage: https://github.com/atlassian/extract-react-types#readme
- Issues: https://github.com/atlassian/extract-react-types/issues
- npm.io page: https://npm.io/package/kind2string

## Dependencies (1)

- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.4.4

## Recent versions

- 0.8.1 (latest) — 2021-01-28
- 0.8.0 — 2020-05-28
- 0.7.3 — 2020-02-20
- 0.7.2 — 2020-01-15
- 0.7.1 — 2019-10-30
- 0.7.0 — 2019-10-25
- 0.6.3 — 2019-08-15
- 0.6.2 — 2019-07-15
- 0.6.1 — 2019-07-08
- 0.6.0 — 2019-07-08
- 0.5.6 — 2019-06-23
- 0.5.5 — 2019-05-29
- 0.5.4 — 2019-05-08
- 0.5.3 — 2019-04-04
- 0.5.2 — 2019-02-14
- … 8 more at https://npm.io/package/kind2string/versions

## README

# Kind 2 String - a parser for extract-react-types

Kind 2 String is designed to take the data structures output by [extract-react-types](https://www.npmjs.com/package/extract-react-types) and convert them to a (useful) string, as well as performing safe traversal through the output of `extract-react-types` so that trying to display information in your docs does not throw errors.

It exposes a `convert` method which allows you to ensure the data structure resolves to a string. It also exposes its `converter` object, allowing you to overwrite converters of your choice, if you wish to perform some other action other than the default string converter.

Default use-case:

```js
import generatedData from './extract-react-type-write-location';
import convert from 'kind2string';

export default () => <div>convert(generatedData)</div>;
```

Also, if you are handling the kinds in a custom way, it is good to pass the final kind to `kind2string`, to ensure that you always pass a string to your react components.

For examples of how to use this, the [@atlaskit/docs](https://www.npmjs.com/package/@atlaskit/docs) uses this package. A good pattern on how to implement `kind2string` can be found in the [prettyproptypes](https://github.com/atlassian/extract-react-types/tree/master/packages/pretty-proptypes) file.

---
_Source: https://npm.io/package/kind2string · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
