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

@theonlydevsever/utilities

v1.9.0

Published

A collection of small and helpful utility functions

Downloads

71

Readme

@theonlydevsever/utilities

test publish tag

Small & helpful utility functions that everyone is tired of writing

Install

// using yarn
yarn add @theonlydevsever/utilities

// using npm
npm install @theonlydevsever/utilities

capitalize

This function capitalizes the first character in a passed string

| Param | Type | Details | Required | | --- | --- | --- | --- | value | string | The string to capitalize. Defaults to an empty string | false

import { capitalize } from "@theonlydevsever/utilities";

const x = "dogs";
const capitalizedX = capitalize(x); // => "Dogs"

const y = "Cats";
const capitalizedY = capitalize(y); // => "Cats"

// The function will also remove any wrapping whitespace
const z = "   it's really spacious in here   ";
const capitalizedZ = capitalize(z); // => "It's really spacious in here"

forceArray

Sometimes, when retrieving a list of records from a third-party API, you will be sent back an array of records or a single record.

To help standardize workflow in your applications, this function forces the return of an array.

| Param | Type | Details | Required | | --- | --- | --- | --- | data | Generic \| Generic[] | A single value or an array of values | true

import { forceArray } from "@theonlydevsever/utilities";

const apiResponse1 = "Volition";
const arr1 = forceArray<string>(apiResponse1); // => ["Volition"]

const apiResponse2 = ["Kezia", "Fortress"];
const arr2 = forceArray<string>(apiResponse2); // => ["Kezia", "Fortress"]

isValueOfType

This function will return whether or not the value passed is of the passed type.

This is useful for standardizing input going in and coming out of a system, as well as ensuring type validity before performing any type specific operations.

| Param | Type | Details | Required | | --- | --- | --- | --- | value | unknown | This value can be anything | true | type | ExtendedPrimitiveType | Can be one of:arraybigintbooleanfunctionnullnumberobjectstringsymbolundefined | true

import { isValueOfType } from "@theonlydevsever/utilities";

const func = () => console.log("Red Stapler");

if (isValueOfType(func, "function")) {
    func();
} else {
    // The value of `func` was not what was expected -- handle this scenario accordingly...
}

// Other Examples
isValueOfType("Pong", "string"); // => true
isValueOfType(42, "array"); // => false
isValueOfType(BigInt(23456), "bigint"); // => true
isValueOfType([1, 2, 3], "array"); // => true
isValueOfType({ id: 1, name: "Bubbles" }, "object") // => true
isValueOfType("function in disguise", "function") // => false