{"id":13346,"library":"is-falsey-x","title":"is-falsey-x utility","description":"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.","status":"active","version":"2.1.1","language":"javascript","source_language":"en","source_url":"https://github.com/Xotic750/is-falsey-x","tags":["javascript","isFalsey","module","nodejs","browser"],"install":[{"cmd":"npm install is-falsey-x","lang":"bash","label":"npm"},{"cmd":"yarn add is-falsey-x","lang":"bash","label":"yarn"},{"cmd":"pnpm add is-falsey-x","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package exports a default function. Use a default import for ESM.","wrong":"import { isFalsey } from 'is-falsey-x';","symbol":"isFalsey","correct":"import isFalsey from 'is-falsey-x';"},{"note":"For CommonJS, the package exports the function directly as `module.exports`.","wrong":"const { isFalsey } = require('is-falsey-x');","symbol":"isFalsey","correct":"const isFalsey = require('is-falsey-x');"},{"note":"TypeScript users can import the module as a default export, and type definitions are typically inferred or provided.","symbol":"isFalsey (TypeScript)","correct":"import isFalsey from 'is-falsey-x';"}],"quickstart":{"code":"import isFalsey from 'is-falsey-x';\n\nconsole.log(isFalsey()); // true (undefined is falsey)\nconsole.log(isFalsey(0)); // true\nconsole.log(isFalsey('')); // true\nconsole.log(isFalsey(false)); // true\nconsole.log(isFalsey(null)); // true\nconsole.log(isFalsey(NaN)); // true\n\nconsole.log(isFalsey(true)); // false\nconsole.log(isFalsey([])); // false (empty array is truthy)\nconsole.log(isFalsey(1)); // false\nconsole.log(isFalsey('hello')); // false\nconsole.log(isFalsey({})); // false (empty object is truthy)\nconsole.log(isFalsey(function() {})); // false","lang":"javascript","description":"This quickstart demonstrates how to import and use the `isFalsey` function to check various JavaScript values for their falsey status."},"warnings":[{"fix":"Upgrade to `is-falsey-x@2.1.1` or the latest stable version using `npm install is-falsey-x@latest`.","message":"Version 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.","severity":"breaking","affected_versions":"<2.1.1"},{"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');`","message":"The 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.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Change the import statement to `import isFalsey from 'is-falsey-x';`.","cause":"Attempting to import `isFalsey` as a named export in an ESM environment when it's a default export.","error":"TypeError: (0 , _isFalseyX.default) is not a function"},{"fix":"Use `const isFalsey = require('is-falsey-x');` instead of `const { isFalsey } = require('is-falsey-x');`.","cause":"Incorrectly destructuring the default export from `require` in a CommonJS module.","error":"TypeError: isFalsey is not a function"},{"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.","cause":"The module was imported but not assigned to a variable or was imported incorrectly, leading to `isFalsey` not being available in the current scope.","error":"ReferenceError: isFalsey is not defined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null}