Registry / testing / is-falsey-x

is-falsey-x

JSON →
library2.1.1jsnpmunverified

The `is-falsey-x` package provides a highly focused utility function, `isFalsey`, designed to accurately determine if a given JavaScript value is 'falsey'. This includes standard JavaScript falsey values such as `false`, `0`, `-0`, `0n` (BigInt zero), `""` (empty string), `null`, `undefined`, and `NaN`. The current stable version is 2.1.1, with the project exhibiting a cadence of frequent minor patch releases, often for 'auto build' purposes, and critical security updates as indicated by the v2.1.1 release. Its key differentiator lies in its minimal footprint and singular purpose, offering a lean alternative to incorporating larger utility libraries like Lodash or Underscore when only a falsey check is needed. It is designed to operate seamlessly across both Node.js environments (requiring Node.js >= 8.11.4) and modern browser contexts.

npm install is-falsey-x
INSTALL
IMPORT
SIG · IS-FALSEY-X
I
is-falsey-x
testingjavascriptv2.1.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

isFalsey
import isFalsey from 'is-falsey-x';
import { isFalsey } from 'is-falsey-x';
This package exports a default function. Use a default import for ESM.
isFalsey
const isFalsey = require('is-falsey-x');
const { isFalsey } = require('is-falsey-x');
For CommonJS, the package exports the function directly as `module.exports`.
isFalsey (TypeScript)
import isFalsey from 'is-falsey-x';
TypeScript users can import the module as a default export, and type definitions are typically inferred or provided.

This quickstart demonstrates how to import and use the `isFalsey` function to check various JavaScript values for their falsey status.

import isFalsey from 'is-falsey-x'; console.log(isFalsey()); // true (undefined is falsey) console.log(isFalsey(0)); // true console.log(isFalsey('')); // true console.log(isFalsey(false)); // true console.log(isFalsey(null)); // true console.log(isFalsey(NaN)); // true console.log(isFalsey(true)); // false console.log(isFalsey([])); // false (empty array is truthy) console.log(isFalsey(1)); // false console.log(isFalsey('hello')); // false console.log(isFalsey({})); // false (empty object is truthy) console.log(isFalsey(function() {})); // false
Debug
Known issues
breakingVersion 2.1.1 included a 'Security update'. While specific details are not provided in the excerpt, it is strongly recommended to update to this version or newer to incorporate any critical security fixes.
fix
Upgrade to `is-falsey-x@2.1.1` or the latest stable version using `npm install is-falsey-x@latest`.
affects: <2.1.1
gotchaThe package exports a default function. Attempting to use named imports (e.g., `import { isFalsey } from 'is-falsey-x';`) will result in a runtime error because no named export `isFalsey` exists.
fix
Always use a default import for ESM: `import isFalsey from 'is-falsey-x';` or direct `require` for CommonJS: `const isFalsey = require('is-falsey-x');`
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: (0 , _isFalseyX.default) is not a function
Attempting to import `isFalsey` as a named export in an ESM environment when it's a default export.
fix
Change the import statement to `import isFalsey from 'is-falsey-x';`.
TypeError: isFalsey is not a function
Incorrectly destructuring the default export from `require` in a CommonJS module.
fix
Use `const isFalsey = require('is-falsey-x');` instead of `const { isFalsey } = require('is-falsey-x');`.
ReferenceError: isFalsey is not defined
The module was imported but not assigned to a variable or was imported incorrectly, leading to `isFalsey` not being available in the current scope.
fix
Ensure the import statement is correctly `import isFalsey from 'is-falsey-x';` or `const isFalsey = require('is-falsey-x');` and that the variable name matches.
Upgrade
Version history
2.1.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
is-falsey-x — npm install is-falsey-x · libregistry