# is-boolean-object

> Is this value a JS Boolean? This module works cross-realm/iframe, and despite ES6 @@toStringTag.

Latest version **1.2.2** (published 2025-02-05) · MIT license · 0 weekly downloads

> **Better alternative:** Use Object.prototype.toString.call(v) === "[object Boolean]" — Consider using a lighter alternative

## Install

```sh
npm install is-boolean-object
pnpm add is-boolean-object
yarn add is-boolean-object
bun add is-boolean-object
```

## Health

**Score 45/100 (D)** — status: stable.

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

Warnings: low downloads; no esm support.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 1.2.2 |
| Published | 2025-02-05 |
| First published | 2015-04-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >= 0.4 |
| Dependencies | 2 |
| Unpacked size | 25.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Jordan Harband |
| Maintainers | ljharb |
| Keywords | Boolean, ES6, toStringTag, @@toStringTag, Boolean object, true, false, is-boolean |

## Links

- npm: https://www.npmjs.com/package/is-boolean-object
- Repository: https://github.com/inspect-js/is-boolean-object
- Homepage: https://github.com/inspect-js/is-boolean-object#readme
- Issues: https://github.com/inspect-js/is-boolean-object/issues
- Funding: https://github.com/sponsors/ljharb
- npm.io page: https://npm.io/package/is-boolean-object

## Dependencies (2)

- [call-bound](https://npm.io/package/call-bound.md) ^1.0.3
- [has-tostringtag](https://npm.io/package/has-tostringtag.md) ^1.0.2

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 1.2.2 (latest) — 2025-02-05
- 1.2.1 — 2024-12-13
- 1.2.0 — 2024-12-02
- 1.1.2 — 2021-08-05
- 1.1.1 — 2021-05-07
- 1.1.0 — 2020-12-06
- 1.0.1 — 2019-12-19
- 1.0.0 — 2015-04-28

## README

# is-boolean-object <sup>[![Version Badge][2]][1]</sup>

[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![dependency status][5]][6]
[![dev dependency status][7]][8]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]

[![npm badge][11]][1]

Is this value a JS Boolean? This module works cross-realm/iframe, and despite ES6 @@toStringTag.

## Example

```js
var isBoolean = require('is-boolean-object');
var assert = require('assert');

assert.notOk(isBoolean(undefined));
assert.notOk(isBoolean(null));
assert.notOk(isBoolean('foo'));
assert.notOk(isBoolean(function () {}));
assert.notOk(isBoolean([]));
assert.notOk(isBoolean({}));
assert.notOk(isBoolean(/a/g));
assert.notOk(isBoolean(new RegExp('a', 'g')));
assert.notOk(isBoolean(new Date()));
assert.notOk(isBoolean(42));
assert.notOk(isBoolean(NaN));
assert.notOk(isBoolean(Infinity));

assert.ok(isBoolean(new Boolean(42)));
assert.ok(isBoolean(false));
assert.ok(isBoolean(Object(false)));
assert.ok(isBoolean(true));
assert.ok(isBoolean(Object(true)));
```

## Tests
Simply clone the repo, `npm install`, and run `npm test`

[1]: https://npmjs.org/package/is-boolean-object
[2]: https://versionbadg.es/inspect-js/is-boolean-object.svg
[5]: https://david-dm.org/inspect-js/is-boolean-object.svg
[6]: https://david-dm.org/inspect-js/is-boolean-object
[7]: https://david-dm.org/inspect-js/is-boolean-object/dev-status.svg
[8]: https://david-dm.org/inspect-js/is-boolean-object#info=devDependencies
[11]: https://nodei.co/npm/is-boolean-object.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/is-boolean-object.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/is-boolean-object.svg
[downloads-url]: https://npm-stat.com/charts.html?package=is-boolean-object
[codecov-image]: https://codecov.io/gh/inspect-js/is-boolean-object/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/inspect-js/is-boolean-object/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/is-boolean-object
[actions-url]: https://github.com/inspect-js/is-boolean-object/actions

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