# is-it-type

> Determine type of a variable

Latest version **5.1.3** (published 2025-07-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install is-it-type
pnpm add is-it-type
yarn add is-it-type
bun add is-it-type
```

## Health

**Score 30/100 (F)** — status: maintenance-mode.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 5.1.3 |
| Published | 2025-07-16 |
| First published | 2019-11-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=12 |
| Dependencies | 1 |
| Unpacked size | 116.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Overlook Motel |
| Maintainers | overlookmotel |
| Keywords | is, type |

## Links

- npm: https://www.npmjs.com/package/is-it-type
- Repository: https://github.com/overlookmotel/is-it-type
- Homepage: https://github.com/overlookmotel/is-it-type#readme
- Issues: https://github.com/overlookmotel/is-it-type/issues
- npm.io page: https://npm.io/package/is-it-type

## Dependencies (1)

- [globalthis](https://npm.io/package/globalthis.md) ^1.0.2

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 5.1.3 (latest) — 2025-07-16
- 5.1.2 — 2022-03-20
- 5.1.1 — 2022-02-01
- 5.1.0 — 2022-02-01
- 5.0.0 — 2020-08-09
- 4.1.1 — 2020-08-09
- 4.1.0 — 2020-06-22
- 4.0.0 — 2020-05-07
- 3.1.1 — 2020-04-04
- 3.1.0 — 2020-04-04
- 3.0.2 — 2020-04-04
- 3.0.1 — 2020-04-04
- 3.0.0 — 2020-04-04
- 2.0.0 — 2020-01-21
- 1.2.0 — 2019-12-27
- … 4 more at https://npm.io/package/is-it-type/versions

## README

[![NPM version](https://img.shields.io/npm/v/is-it-type.svg)](https://www.npmjs.com/package/is-it-type)
[![Build Status](https://img.shields.io/github/workflow/status/overlookmotel/is-it-type/Test.svg)](https://github.com/overlookmotel/is-it-type/actions)
[![Dependency Status](https://img.shields.io/david/overlookmotel/is-it-type.svg)](https://david-dm.org/overlookmotel/is-it-type)
[![Dev dependency Status](https://img.shields.io/david/dev/overlookmotel/is-it-type.svg)](https://david-dm.org/overlookmotel/is-it-type)
[![Coverage Status](https://img.shields.io/coveralls/overlookmotel/is-it-type/master.svg)](https://coveralls.io/r/overlookmotel/is-it-type)

# Determine type of a variable

All the functions from [core-util-is](https://www.npmjs.com/package/core-util-is) plus a few extras, in both CJS and ESM formats for use in Node.js or browser.

## Usage

### Import

```js
const { isString } = require('is-it-type');
```

or:

```js
import { isString } from 'is-it-type';
```

### Use a method

```js
isString('abc'); // true
```

All methods return `true` or `false`.

## Methods

### Same as [core-util-is](https://www.npmjs.com/package/core-util-is):

* `isArray`
* `isBoolean`
* `isNull`
* `isNullOrUndefined`
* `isNumber`
* `isString`
* `isSymbol`
* `isUndefined`
* `isRegExp`
* `isDate`
* `isError`
* `isFunction`
* `isPrimitive`

NB [core-util-is](https://www.npmjs.com/package/core-util-is)'s `isBuffer` is not included. `isObject` method differs from [core-util-is](https://www.npmjs.com/package/core-util-is)'s method of same name (see [below](#objects)).

### Additional functions

#### Strings

* `isEmptyString` - `true` if `=== ''`
* `isFullString` - `true` if a string which `!== ''`

#### Numbers

* `isInteger` - `true` if is an integer number (positive, negative or zero)
* `isPositiveInteger` - `true` if is an integer number > 0
* `isPositiveIntegerOrZero` - `true` if is an integer number >= 0
* `isNegativeInteger` - `true` if is an integer number < 0
* `isNegativeIntegerOrZero` - `true` if is an integer number <= 0

#### Objects

* `isObject` - `true` if passed object (not including arrays, regexps and other built-ins)
* `isEmptyObject` - `true` if passed object with no properties

#### Other

* `isType( type, input )` - `true` if `typeof input === type`

## Versioning

This module follows [semver](https://semver.org/). Breaking changes will only be made in major version updates.

All active NodeJS release lines are supported (v12+ at time of writing). After a release line of NodeJS reaches end of life according to [Node's LTS schedule](https://nodejs.org/en/about/releases/), support for that version of Node may be dropped at any time, and this will not be considered a breaking change. Dropping support for a Node version will be made in a minor version update (e.g. 1.2.0 to 1.3.0). If you are using a Node version which is approaching end of life, pin your dependency of this module to patch updates only using tilde (`~`) e.g. `~1.2.3` to avoid breakages.

## Tests

Use `npm test` to run the tests. Use `npm run cover` to check coverage.

## Changelog

See [changelog.md](https://github.com/overlookmotel/is-it-type/blob/master/changelog.md)

## Issues

If you discover a bug, please raise an issue on Github. https://github.com/overlookmotel/is-it-type/issues

## Contribution

Pull requests are very welcome. Please:

* ensure all tests pass before submitting PR
* add tests for new features
* document new functionality/API additions in README
* do not add an entry to Changelog (Changelog is created when cutting releases)

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