# to-type-string

> Get type description of a JavaScript variable

Latest version **2.0.1** (published 2022-04-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install to-type-string
pnpm add to-type-string
yarn add to-type-string
bun add to-type-string
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2022-04-27 |
| First published | 2018-11-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=12.0.0 |
| Dependencies | 0 |
| Unpacked size | 4.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Mgenware |
| Maintainers | mgenware |

## Links

- npm: https://www.npmjs.com/package/to-type-string
- Repository: https://github.com/mgenware/to-type-string
- Issues: https://github.com/mgenware/to-type-string/issues
- npm.io page: https://npm.io/package/to-type-string

## Recent versions

- 2.0.1 (latest) — 2022-04-27
- 2.0.0 — 2021-02-26
- 1.1.0 — 2020-10-15
- 1.0.2 — 2019-12-24
- 1.0.1 — 2019-07-05
- 1.0.0 — 2018-11-21

## README

# to-type-string

[![Build Status](https://github.com/mgenware/to-type-string/workflows/Build/badge.svg)](https://github.com/mgenware/to-type-string/actions)
[![npm version](https://img.shields.io/npm/v/to-type-string.svg?style=flat-square)](https://npmjs.com/package/to-type-string)
[![Node.js Version](http://img.shields.io/node/v/to-type-string.svg?style=flat-square)](https://nodejs.org/en/)

Get type description of a JavaScript variable

## Installation

```sh
npm install to-type-string
```

## Usage

```js
import toTypeString from 'to-type-string';

class MyClass {}

toTypeString(null); // null
toTypeString(undefined); // undefined
toTypeString(new MyClass()); // MyClass
toTypeString([1, 3, 2]); // Array
toTypeString(() => 'haha'); // function
toTypeString(/abc/); // RegExp
toTypeString(NaN); // number
toTypeString(new Uint16Array(10)); // Uint16Array
toTypeString(new Date()); // Date
toTypeString(new Object()); // Object
```

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