# boolbase

> two functions: One that returns true, one that returns false

Latest version **2.0.0** (published 2026-03-17) · ISC license · 0 weekly downloads

## Install

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

## Health

**Score 65/100 (B)** — status: stable.

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2026-03-17 |
| First published | 2014-02-15 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=20.19.0 |
| Dependencies | 0 |
| Unpacked size | 2.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 21 |
| Author | Felix Boehm |
| Maintainers | fb55 |
| Keywords | boolean, function |

## Links

- npm: https://www.npmjs.com/package/boolbase
- Repository: https://github.com/fb55/boolbase
- Issues: https://github.com/fb55/boolbase/issues
- Funding: https://github.com/sponsors/fb55
- npm.io page: https://npm.io/package/boolbase

## Recent versions

- 2.0.0 (latest) — 2026-03-17
- 1.0.0 — 2014-02-15

## README

# boolbase
This very simple module provides two basic functions, one that always returns true (`trueFunc`) and one that always returns false (`falseFunc`).

### Why is this needed?

By having only a single instance of these functions around, it's possible to do some nice optimizations.
Eg. [`css-select`](https://github.com/fb55/css-select) uses these functions to determine whether a selector won't match any elements
If that's the case, the DOM doesn't even need to be touched.

### And why is this a separate module?

I'm trying to modularize `css-select` and most modules depend on these functions.
IMHO, having a separate module is the easiest solution to this problem.

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