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
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
isNull
✓ import isNull from 'lodash.isnull'
✗ import { isNull } from 'lodash.isnull'
This package exports `isNull` as the default export for ES Modules. Named imports like `{ isNull }` will fail. For tree-shaking with modern Lodash versions (v4.x+), prefer `import { isNull } from 'lodash-es'` or `import isNull from 'lodash/isNull'`.
isNull
✓ const isNull = require('lodash.isnull');
This is the standard CommonJS import pattern. The package is primarily designed for this module system as indicated by its v3.0.0 release date. Ensure you are not in an ESM-only environment if using `require()`.
_
✓ const _ = require('lodash'); // Then use _.isNull
✗ const _ = require('lodash.isnull'); // Then use _.isNull
The `lodash.isnull` package exports only the `isNull` function, not the full `_` object. To access `_.isNull` from the main Lodash object, you need to import the entire `lodash` library. Note that `lodash.isnull@3.0.0`'s behavior corresponds to `lodash@3.x`.
This quickstart demonstrates how to import and use the `isNull` function from `lodash.isnull` to check if various values are strictly `null` in both ES Module and CommonJS contexts.
import isNull from 'lodash.isnull';
console.log('Checking for null values:');
let value1 = null;
let value2 = undefined;
let value3 = 0;
let value4 = '';
let value5 = false;
let value6 = {};
console.log(`Is value1 (null) null? ${isNull(value1)}`);
console.log(`Is value2 (undefined) null? ${isNull(value2)}`);
console.log(`Is value3 (0) null? ${isNull(value3)}`);
console.log(`Is value4 ('') null? ${isNull(value4)}`);
console.log(`Is value5 (false) null? ${isNull(value5)}`);
console.log(`Is value6 ({}) null? ${isNull(value6)}`);
// Demonstrating CommonJS usage for older environments
const isNullCJS = require('lodash.isnull');
console.log(`\nCJS check: Is null null? ${isNullCJS(null)}`);
Debug
Known issues
breakingThis `lodash.isnull` package is version `3.0.0`, corresponding to the `lodash v3` era. The main `lodash` library is currently at `v4.x` and has significant breaking changes between v3 and v4. Using `lodash.isnull@3.0.0` alongside a `lodash v4.x` installation (or `lodash-es`) may lead to inconsistent behavior if `_.isNull`'s implementation changed, or simply mean you're missing bug fixes and new features from the modern Lodash version.fixFor new projects or compatibility with Lodash v4.x+, consider using `import { isNull } from 'lodash-es'` for tree-shaking, or `import { isNull } from 'lodash'` if you're comfortable with the full library import. Alternatively, use native `value === null` for a strict null check. affects: >=3.0.0
deprecatedThe modular `lodash.*` packages like `lodash.isnull` are largely superseded. For modern JavaScript environments, `lodash-es` is the recommended way to import individual Lodash functions with efficient tree-shaking, resulting in smaller bundle sizes. Direct imports like `import isNull from 'lodash/isNull'` (which requires installing the main `lodash` package) also provide tree-shakable benefits with modern bundlers.fixSwitch to `import { isNull } from 'lodash-es'` for projects using ES Modules and modern bundlers (like Webpack 4+ or Parcel), or `import isNull from 'lodash/isNull'` if you prefer to import from the main `lodash` package. affects: >=3.0.0
gotchaThis package exports `isNull` as a default export in ES Module contexts (e.g., `import isNull from 'lodash.isnull'`). Attempting to use a named import (`import { isNull } from 'lodash.isnull'`) will result in an error, as there is no named export for `isNull`.fixAlways use `import isNull from 'lodash.isnull'` when importing this specific package as an ES Module. If you need named imports, consider `lodash-es` instead (`import { isNull } from 'lodash-es'`). affects: >=3.0.0
gotchaSeveral security vulnerabilities, including prototype pollution and arbitrary code injection, have been identified and patched in `lodash v4.x`. As `lodash.isnull@3.0.0` is based on `lodash v3`, it will not receive these critical security updates. While `_.isNull` itself is a simple function and might not directly expose these vulnerabilities, relying on an outdated `lodash` version can pose broader security risks in your application's dependency tree.fixMigrate away from `lodash.isnull@3.0.0` to ensure your application benefits from current security patches. The recommended approach is to use `lodash-es` or direct imports from `lodash` (v4.18.1 or higher) to ensure you are on a securely maintained version of the library. Alternatively, consider using the native JavaScript strict equality check `value === null` which provides the same core functionality and eliminates the dependency.
affects: <4.18.1 (for main lodash)
Errors
Common errors & fixes
TypeError: lodash_isnull_1.isNull is not a function
Attempting to import `isNull` as a named export (`import { isNull } from 'lodash.isnull'`) when it is provided as a default export.
fixChange the import statement to `import isNull from 'lodash.isnull';`
ReferenceError: require is not defined
Using `require('lodash.isnull')` in an ES Module environment without a compatibility layer or proper transpilation.
fixFor ES Module environments, use `import isNull from 'lodash.isnull';`. If targeting modern Lodash features, consider `import { isNull } from 'lodash-es';`. npm WARN deprecated lodash@1.0.2: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^3.0.0.
This warning indicates that an older, unmaintained version of the *main* `lodash` library (or one of its modular packages from the same era) is being used. While this specific `lodash.isnull` package is at `3.0.0`, this warning refers to dependencies that might pull in even older `lodash` versions, highlighting the general issue of outdated `lodash` usage.
fixReview your `package.json` and `npm ls lodash` (or `npm ls lodash.isnull`) to identify which dependencies are pulling in outdated `lodash` versions. Update those dependencies or, if possible, upgrade to `lodash-es` or the latest `lodash` package (v4.18.1 or higher) directly.
Audit
Dependencies
No dependency data recorded yet.