
Security Fundamentals
Turtles, Clams, and Cyber Threat Actors: Shell Usage
The Socket Threat Research Team uncovers how threat actors weaponize shell techniques across npm, PyPI, and Go ecosystems to maintain persistence and exfiltrate data.
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 is-obj
import isObject from 'is-obj';
isObject({foo: 'bar'});
//=> true
isObject([1, 2, 3]);
//=> true
isObject('foo');
//=> false
FAQs
Check if a value is an object
The npm package is-obj receives a total of 24,079,457 weekly downloads. As such, is-obj popularity was classified as popular.
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 Fundamentals
The Socket Threat Research Team uncovers how threat actors weaponize shell techniques across npm, PyPI, and Go ecosystems to maintain persistence and exfiltrate data.
Security News
At VulnCon 2025, NIST scrapped its NVD consortium plans, admitted it can't keep up with CVEs, and outlined automation efforts amid a mounting backlog.
Product
We redesigned our GitHub PR comments to deliver clear, actionable security insights without adding noise to your workflow.