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

@deebeetech/is-helper

v3.0.0

Published

A collection of "is"-style helpers to help solidify if something "is" something else. Has no dependencies and uses only raw JavaScript methodology.

Readme

is-helper

Zero-dependency type-checking utilities for JavaScript and TypeScript. Every check works with unknown values and returns proper type guards where possible.

Install

npm install @deebeetech/is-helper

Usage

import is from "@deebeetech/is-helper";

Null, Undefined, and Friends

is.null(null);        // true
is.null(undefined);   // false

is.undefined(undefined); // true
is.undefined(null);      // false

is.nil(null);       // true  — null OR undefined
is.nil(undefined);  // true
is.nil(0);          // false

is.defined(0);         // true  — anything that isn't null/undefined
is.defined(null);      // false

is.nothing(null);        // true  — null, undefined, empty string, or whitespace
is.nothing("");          // true
is.nothing("   ");       // true
is.nothing("hello");     // false

Strings

is.string("hello");    // true
is.string(42);         // false

is.string.empty("");       // true
is.string.empty("hi");     // false

is.string.whitespace("   ");   // true  — non-empty, all whitespace
is.string.whitespace("");      // false

is.string.blank("");       // true  — empty OR whitespace-only
is.string.blank("   ");   // true
is.string.blank("hi");    // false

Numbers

Numeric strings like "42" and "3.14" are treated as numbers too (up to two decimal places).

is.number(42);       // true
is.number("3.14");   // true
is.number("");       // false
is.number(null);     // false

is.number.positive(5);    // true
is.number.positive(-1);   // false
is.number.positive("10"); // true

is.number.integer(7);      // true
is.number.integer(3.5);    // false

is.number.positiveInteger(3);    // true
is.number.positiveInteger(-2);   // false
is.number.positiveInteger(1.5);  // false

Booleans

Goes beyond typeof — recognizes "true", "false", "y", "n", "yes", "no", "1", "0", and the numbers 1 and 0.

is.boolean(true);     // true
is.boolean("yes");    // true
is.boolean("n");      // true
is.boolean(1);        // true
is.boolean("maybe");  // false

Use is.boolean.value() to extract the actual boolean:

is.boolean.value("yes");   // true
is.boolean.value("n");     // false
is.boolean.value(0);       // false
is.boolean.value("true");  // true

Arrays

Covers regular arrays and all typed arrays (Float64Array, Uint8Array, etc.).

is.array([1, 2, 3]);            // true
is.array(new Uint8Array(4));     // true
is.array("not an array");       // false

is.array.empty([]);              // true
is.array.empty([1]);             // false

is.array.nonEmpty([1, 2]);       // true
is.array.nonEmpty([]);           // false

Objects

Only plain {} objects — arrays, null, and functions don't count.

is.object({ a: 1 });     // true
is.object([1, 2]);        // false
is.object(null);          // false

is.object.empty({});          // true
is.object.empty({ a: 1 });   // false

is.object.plain({});                        // true
is.object.plain(Object.create(null));       // true
is.object.plain(new (class Foo {}));        // false

Functions

is.fn(() => {});          // true
is.fn(console.log);       // true
is.fn("not a function");  // false

Dates

is.date(new Date());     // true
is.date("2024-01-01");   // false

IPv4

is.ipv4("192.168.1.1");     // true
is.ipv4("999.999.999.999"); // false
is.ipv4("not an ip");       // false

Combinators

is.any() and is.all() let you compose checks into reusable validators.

const isStringOrNumber = is.any(is.string, is.number);
isStringOrNumber("hello");  // true
isStringOrNumber(42);       // true
isStringOrNumber(null);     // false

const isPositiveInt = is.all(is.number.positive, is.number.integer);
isPositiveInt(5);     // true
isPositiveInt(-3);    // false
isPositiveInt(2.5);   // false

TypeScript

Most checks double as type guards, so the compiler narrows types automatically:

function greet(name: unknown) {
   if (is.string(name)) {
      console.log(name.toUpperCase()); // name is narrowed to string
   }
}

License

MIT