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

@utilify/types

v1.0.0

Published

A utility library for type checks and type manipulation in JavaScript and TypeScript, providing functions to determine types and verify values like null, undefined, boolean, number, and more.

Downloads

127

Readme

Type Utilities

Type utility functions provide methods to check, compare, and manipulate data types. They help identify if a value is of a specific type, such as checking if a value is a number, string, function, or a primitive value, as well as other useful checks.

Installation

To install the type utility functions, use one of the following commands, depending on your package manager:

npm install @utilify/types
yarn add @utilify/types
pnpm add @utilify/types

Once installed, you can import the functions into your project, using either ESM or CJS.

Usage

This library supports both the ESM and CJS module systems.

import { isString } from '@utilify/types'; 
const { isString } = require('@utilify/types');  

Overview

Here is an overview of the functions available in the type utilities category:

getInstanceType

function getInstanceType(value: object): string | undefined 

Returns the instance type of the value.

getType

function getType(value: any): string 

Returns the primitive type or the type of the object (such as "string", "object", "function", etc.).

isAsync

function isAsync(callback: Function): boolean

Checks if the function is asynchronous.

isArray

function isArray(value: any): boolean

Checks if the value is an array.

isBigint

function isBigint(value: any): boolean  

Checks if the value is a BigInt.

isBoolean

function isBoolean(value: any): boolean  

Checks if the value is a boolean.

isDate

function isDate(value: any): boolean  

Checks if the value is an instance of Date.

isEqualType

function isEqualType(value1: any, value2: any): boolean  

Compares the types of two values and returns if they are the same.

isFalsy

function isFalsy(value: any): boolean  

Checks if the value is "falsy" (such as false, 0, null, undefined, NaN, or an empty string).

isFunction

function isFunction(value: any): boolean  

Checks if the value is a function.

isMap

function isMap(value: any): boolean  

Checks if the value is an instance of Map.

isNull

function isNull(value: any): boolean  

Checks if the value is null.

isNumber

function isNumber(value: any): boolean  

Checks if the value is a number.

isObject

function isObject(value: any): boolean  

Checks if the provided value is a plain object or an object created from a non-native class.

isPlainObject

function isPlainObject(value: any): boolean  

Checks if the value is a plain object (not an instance of Map, Set, or other objects).

isPromise

function isPromise(value: object): boolean  

Checks if the value is a Promise.

isRegExp

function isRegExp(value: any): boolean  

Checks if the value is a regular expression.

isSet

function isSet(value: any): boolean  

Checks if the value is an instance of Set.

isString

function isString(value: any): boolean  

Checks if the value is a string.

isSymbol

function isSymbol(value: any): boolean  

Checks if the value is a Symbol.

isTruthy

function isTruthy(value: any): boolean  

Checks if the value is "truthy" (any value that is not false, 0, null, undefined, NaN, or an empty string).

isUndefined

function isUndefined(value: any): boolean  

Checks if the value is undefined.

isJSON

function isJSON(value: any): boolean  

Checks if the value is a valid JSON object.

isPrimitive

function isPrimitive(value: any): boolean  

Checks if the value is a primitive type (string, number, bigint, boolean, symbol, undefined, null).