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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@kuibu/typejs

v1.0.0

Published

A lightweight front-end data type detection library

Readme

@kuibu/typejs

A lightweight front-end data type detection library.

Installation

npm i @kuibu/typejs

Usage

bundle

Using in commonjs projects:

const { isString } = require('@kuibu/typejs');

Using in esmodule projects:

import { isString } from '@kuibu/typejs';

bundleless

Using in commonjs projects:

const isString = require('@kuibu/typejs/lib/isString');

Using in esmodule projects:

import isString from '@kuibu/typejs/es/isString';

Example

isString

import { isString } from '@kuibu/typejs';

isString(''); // true
isString(NaN); // false
isString(0); // false
isString(false); // false
isString(null); // false
isString(undefined); // false
isString({}); // false
isString([]); // false
isString(() => {}); // false

isNumber

import { isNumber } from '@kuibu/typejs';

isNumber(''); // false
isNumber(NaN); // true
isNumber(0); // true
isNumber(false); // false
isNumber(null); // false
isNumber(undefined); // false
isNumber({}); // false
isNumber([]); // false
isNumber(() => {}); // false

isBoolean

import { isBoolean } from '@kuibu/typejs';

isBoolean(''); // false
isBoolean(NaN); // false
isBoolean(0); // false
isBoolean(false); // true
isBoolean(null); // false
isBoolean(undefined); // false
isBoolean({}); // false
isBoolean([]); // false
isBoolean(() => {}); // false

isNull

import { isNull } from '@kuibu/typejs';

isNull(''); // false
isNull(NaN); // false
isNull(0); // false
isNull(false); // false
isNull(null); // true
isNull(undefined); // false
isNull({}); // false
isNull([]); // false
isNull(() => {}); // false

isUndefined

import { isUndefined } from '@kuibu/typejs';

isUndefined(''); // false
isUndefined(NaN); // false
isUndefined(0); // false
isUndefined(false); // false
isUndefined(null); // false
isUndefined(undefined); // true
isUndefined({}); // false
isUndefined([]); // false
isUndefined(() => {}); // false

isObject

import { isObject } from '@kuibu/typejs';

isObject(''); // false
isObject(NaN); // false
isObject(0); // false
isObject(false); // false
isObject(null); // false
isObject(undefined); // false
isObject({}); // true
isObject([]); // false
isObject(() => {}); // false

isArray

import { isArray } from '@kuibu/typejs';

isArray(''); // false
isArray(NaN); // false
isArray(0); // false
isArray(false); // false
isArray(null); // false
isArray(undefined); // false
isArray({}); // false
isArray([]); // true
isArray(() => {}); // false

isFunction

import { isFunction } from '@kuibu/typejs';

isFunction(''); // false
isFunction(NaN); // false
isFunction(0); // false
isFunction(false); // false
isFunction(null); // false
isFunction(undefined); // false
isFunction({}); // false
isFunction([]); // false
isFunction(() => {}); // true

isValidNumber

import { isValidNumber } from '@kuibu/typejs';

isValidNumber(''); // false
isValidNumber(NaN); // false
isValidNumber(0); // true
isValidNumber(false); // false
isValidNumber(null); // false
isValidNumber(undefined); // false
isValidNumber({}); // false
isValidNumber([]); // false
isValidNumber(() => {}); // false

isNonEmptyString

import { isNonEmptyString } from '@kuibu/typejs';

isNonEmptyString(''); // false
isNonEmptyString('	'); // true
isNonEmptyString(NaN); // false
isNonEmptyString(0); // false
isNonEmptyString(false); // false
isNonEmptyString(null); // false
isNonEmptyString(undefined); // false
isNonEmptyString({}); // false
isNonEmptyString([]); // false
isNonEmptyString(() => {}); // false

isNonEmptyObject

import { isNonEmptyObject } from '@kuibu/typejs';

isNonEmptyObject(''); // false
isNonEmptyObject(NaN); // false
isNonEmptyObject(0); // false
isNonEmptyObject(false); // false
isNonEmptyObject(null); // false
isNonEmptyObject(undefined); // false
isNonEmptyObject({}); // false
isNonEmptyObject({ a: [] }); // true
isNonEmptyObject([]); // false
isNonEmptyObject(() => {}); // false

isNonEmptyArray

import { isNonEmptyArray } from '@kuibu/typejs';

isNonEmptyArray(''); // false
isNonEmptyArray(NaN); // false
isNonEmptyArray(0); // false
isNonEmptyArray(false); // false
isNonEmptyArray(null); // false
isNonEmptyArray(undefined); // false
isNonEmptyArray({}); // false
isNonEmptyArray([]); // false
isNonEmptyArray([{}]); // true
isNonEmptyArray(() => {}); // false

isEmpty

import { isEmpty } from '@kuibu/typejs';

isEmpty(''); // true
isEmpty(NaN); // true
isEmpty(0); // false
isEmpty(false); // false
isEmpty(null); // true
isEmpty(undefined); // true
isEmpty({}); // true
isEmpty([]); // true
isEmpty(() => {}); // false

isType

It is applicable for determining other types,if there is a class as follows:

class Other {
    get [Symbol.toStringTag]() {
        return 'Other';
    }
}

import { isType } from '@kuibu/typejs';
isType(new Other, 'Other'); // true