# type-from

> Get type from given argument

Latest version **1.0.1** (published 2018-04-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install type-from
pnpm add type-from
yarn add type-from
bun add type-from
```

## 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.1 |
| Published | 2018-04-15 |
| First published | 2018-04-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Caio Gondim |
| Maintainers | caiogondim |
| Keywords | type, typeof, cast, checking |

## Links

- npm: https://www.npmjs.com/package/type-from
- Repository: https://github.com/caiogondim/type-from.js
- Homepage: https://github.com/caiogondim/type-from.js#readme
- Issues: https://github.com/caiogondim/type-from.js/issues
- npm.io page: https://npm.io/package/type-from

## Recent versions

- 1.0.1 (latest) — 2018-04-15
- 1.0.0 — 2018-04-15

## README

# type-from

Get type from given argument.

## Installation

```console
npm install --save type-from
```

## Usage

```js
typeFrom({}) // => 'object'
typeFrom([]) // => 'array'
typeFrom(1) // => 'number'
typeFrom('lorem') // => 'string'
typeFrom(() => {})) // => 'function'
typeFrom(Symbol('lorem')) // => 'symbol'
typeFrom(true) // => 'boolean'
typeFrom(null) // => 'null'
typeFrom(undefined) // => 'undefined'
typeFrom(/.*/) // => 'regexp'
typeFrom(new Date) // => 'date'
typeFrom(new Error) // => 'error'
typeFrom(new Uint8Array) // => 'uint'
typeFrom(new Int8Array) // => 'int'
typeFrom(new Float32Array) // => 'float'
typeFrom(new Map) // => 'map'
typeFrom(new Set) // => 'set'
typeFrom(new WeakMap) // => 'weakmap'
typeFrom(new WeakSet) // => 'weakset'
typeFrom(new Promise(() => {})) // => 'promise'
typeFrom(function* () {}) // => 'generatorfunction'
function foo() {
  typeFrom(arguments) // => 'arguments'
}
```

---

[caiogondim.com](https://caiogondim.com) &nbsp;&middot;&nbsp;
GitHub [@caiogondim](https://github.com/caiogondim) &nbsp;&middot;&nbsp;
Twitter [@caio_gondim](https://twitter.com/caio_gondim)

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