
Product
Socket for Jira Is Now Available
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.
Check whether a value is empty.
$ npm install is-empty
$ npm test
var empty = require('is-empty');
empty([]); // true
empty({}); // true
empty(''); // true
empty(0); // true
empty(function(){}); // true
empty(null); // true
empty(undefined); // true
empty(new Map()); // true
empty(new Set()); // true
empty(new Error()); // true
empty(true); // false
empty(false); // false
empty(['a', 'b']); // false
empty({ a: 'b' }); // false
empty('string'); // false
empty(42); // false
empty(function(a,b){}); // false
empty(new Map([['key', 'value']])); // false
empty(new Set([1])); // false
empty(new Error('fail'))// false
Check whether value is empty.
MIT
Lodash's isEmpty function is a part of the Lodash library, which is a comprehensive utility library for JavaScript. It provides similar functionality to is-empty, allowing you to check if a value is empty. However, Lodash is a larger library with many more utilities, which might be overkill if you only need the isEmpty functionality.
The validator package is primarily used for string validation and sanitization, but it includes an isEmpty function to check if a string is empty. While it offers similar functionality for strings, it does not provide the same breadth of checks for other data types as is-empty does.
Underscore is another utility library similar to Lodash. It includes an isEmpty function that checks if an object, array, or other collection is empty. Like Lodash, it offers a wide range of utilities beyond just checking for emptiness, making it a more heavyweight option compared to is-empty.
FAQs
Check whether a value is "empty".
The npm package is-empty receives a total of 435,144 weekly downloads. As such, is-empty popularity was classified as popular.
We found that is-empty demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.