npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@return-continue/is-empty-value

v1.0.1

Published

Check if a value is empty (null, undefined, empty string, empty array, or empty object)

Downloads

316

Readme

@return-continue/is-empty-value

A lightweight TypeScript/JavaScript utility for checking whether a value is empty.

Features

  • ✅ Works with JavaScript and TypeScript
  • ✅ Zero runtime dependencies
  • ✅ Lightweight and fast
  • ✅ Includes TypeScript type definitions
  • ✅ Supports strings, arrays, objects, Map, Set, null, and undefined

Installation

Using npm:

npm install @return-continue/is-empty-value

Using Yarn:

yarn add @return-continue/is-empty-value

Using pnpm:

pnpm add @return-continue/is-empty-value

Usage

TypeScript

import { isEmptyValue } from "@return-continue/is-empty-value";

console.log(isEmptyValue(""));            // true
console.log(isEmptyValue("   "));         // true
console.log(isEmptyValue([]));            // true
console.log(isEmptyValue({}));            // true
console.log(isEmptyValue(new Map()));     // true
console.log(isEmptyValue(new Set()));     // true
console.log(isEmptyValue(null));          // true
console.log(isEmptyValue(undefined));     // true

console.log(isEmptyValue("Hello"));       // false
console.log(isEmptyValue([1, 2]));        // false
console.log(isEmptyValue({ id: 1 }));     // false
console.log(isEmptyValue(new Map([[1, "A"]]))); // false
console.log(isEmptyValue(new Set([1])));  // false
console.log(isEmptyValue(0));             // false
console.log(isEmptyValue(false));         // false

JavaScript (ES Modules)

import { isEmptyValue } from "@return-continue/is-empty-value";

console.log(isEmptyValue([]));

JavaScript (CommonJS)

const { isEmptyValue } = require("@return-continue/is-empty-value");

console.log(isEmptyValue({}));

API

isEmptyValue(value): boolean

Returns true if the provided value is considered empty.

Returns true

  • null
  • undefined
  • Empty string ("")
  • Whitespace-only string (" ")
  • Empty array ([])
  • Empty object ({})
  • Empty Map
  • Empty Set

Returns false

  • Non-empty strings
  • Non-empty arrays
  • Objects with one or more own enumerable properties
  • Non-empty Map
  • Non-empty Set
  • Numbers
  • Booleans
  • Functions

Examples

isEmptyValue("");                     // true
isEmptyValue("   ");                  // true
isEmptyValue(null);                   // true
isEmptyValue(undefined);              // true
isEmptyValue([]);                     // true
isEmptyValue({});                     // true
isEmptyValue(new Map());              // true
isEmptyValue(new Set());              // true

isEmptyValue("OpenAI");               // false
isEmptyValue([1, 2]);                 // false
isEmptyValue({ id: 1 });              // false
isEmptyValue(new Map([[1, "A"]]));    // false
isEmptyValue(new Set([1]));           // false
isEmptyValue(0);                      // false
isEmptyValue(false);                  // false

TypeScript Support

This package is written in TypeScript and includes type definitions out of the box. No additional configuration is required.

License

MIT