
Security News
NVD Concedes Inability to Keep Pace with Surging CVE Disclosures in 2025
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
The is-obj package is a simple utility that allows you to check if a value is a non-null object. It is useful when you want to ensure that a value is an object type (excluding null, arrays, and other non-plain objects) before performing operations that are specific to objects.
Check if a value is a non-null object
This feature allows you to verify if a given value is a non-null object. It returns true for plain objects and false for null, arrays, functions, and other non-object types.
const isObj = require('is-obj');
console.log(isObj({})); // true
console.log(isObj(null)); // false
console.log(isObj([])); // false
console.log(isObj('hello')); // false
is-plain-object is a package that checks if an object is a plain object, that is, an object created by the Object constructor or one with a null prototype. It is similar to is-obj but also checks if the object is created by the Object constructor, which is-obj does not do.
isobject is another npm package that checks if a value is an object and not an array or null. It is similar to is-obj but also returns true for functions, which is-obj does not.
lodash.isplainobject is a method from the popular Lodash library that checks if a value is a plain object. It is more comprehensive than is-obj as it includes additional checks to determine if the object is plain.
Check if a value is an object
Keep in mind that array, function, regexp, etc, are objects in JavaScript.
See is-plain-obj
if you want to check for plain objects.
$ npm install --save is-obj
var isObj = require('is-obj');
isObj({foo: 'bar'});
//=> true
isObj([1, 2, 3]);
//=> true
isObj('foo');
//=> true
MIT © Sindre Sorhus
FAQs
Check if a value is an object
We found that is-obj demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
Security Fundamentals
Attackers use obfuscation to hide malware in open source packages. Learn how to spot these techniques across npm, PyPI, Maven, and more.
Security News
Join Socket for exclusive networking events, rooftop gatherings, and one-on-one meetings during BSidesSF and RSA 2025 in San Francisco.