# typeasy

> 用于判断类型的工具库

Latest version **1.0.0** (published 2020-10-15) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2020-10-15 |
| First published | 2020-10-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 8.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | inlym |
| Maintainers | inlym |

## Links

- npm: https://www.npmjs.com/package/typeasy
- Repository: https://github.com/inlym/typeasy
- Homepage: https://github.com/inlym/typeasy#readme
- Issues: https://github.com/inlym/typeasy/issues
- npm.io page: https://npm.io/package/typeasy

## Recent versions

- 1.0.0 (latest) — 2020-10-15

## README

# typeasy
用于判断数据类型的简易工具库


## 安装
```javascript
npm i typeasy
```


## 使用
```javascript
const typeasy = require('typeasy')    // 引用
console.log(typeasy('hello'))    // string
console.log(typeasy([1,2]))    // array
...
```


## 与 typeof 对比
以下是各数据类型，使用 typeasy 的值和使用 typeof 的值对比，可以看出使用 typeasy 可以更准确地获取数据类型。

| 数据类型 | 示例 | typeasy | typeof |
| :---: | :---: | :---: | :---: |
| 数值 | 123 | number | number |
| 字符串 | 'hello' | string | string |
| 布尔 | true | boolean | boolean |
| 列表 | [1,2] | array | object |
| 函数 | function ( ){ } | function | function |
| null | null | null | object |
| undefined | undefined | undefined | undefined |
| 普通对象 | { name:'mark' } | object | object |
| 时间对象 | new Date( ) | date | object |
| 正则对象 | /^1[3&#124;4&#124;5&#124;6&#124;7&#124;8&#124;9][0-9]{9}$/ | regexp | object |
| 错误对象 | new Error('errMsg') | error | object |
| Symbol对象 | Symbol('dec') | symbol | symbol |
| Promise对象 | new Promise(function (resovle, reject) {}) | promise | object |
| Set对象 | new Set( ) | set | object |

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