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

@44north/utilities

v0.6.2

Published

[![44 North](https://res.cloudinary.com/fortyfournorth/image/upload/v1644103323/44North/ReadmeFileBanner_ixvgvr.jpg)](https://fortyfournorth.ca)

Downloads

6

Readme

44 North

@44north/utilities

A Module containing a number of small utilities to use in your applications

Install

npm install @44north/utilities

or

yarn add @44north/utilities

capitalize

import { capitalize } from "@44north/utilities";

const value = "foo bar";

console.log(capitalize(value)); // -> Foo bar

uppercase

import { uppercase } from "@44north/utilities";

const value = "foobar";

console.log(uppercase(value)); // -> FOOBAR

lowercase

import { lowercase } from "@44north/utilities";

const value = "FOOBAR";

console.log(lowercase(value)); // -> foobar

camelCase

import { camelCase } from "@44north/utilities";

const value = "foo-bar";

console.log(camelCase(value)); // -> fooBar

pascalCase

import { pascalCase } from "@44north/utilities";

const value = "foo_bar";

console.log(pascalCase(value)); // -> FooBart

formatPrice

import { formatPrice } from "@44north/utilities";

const value = 1000;

console.log(formatPrice(value)); // -> "$1,000.00"

optionally Pass in some options to the formatter

import { formatPrice } from "@44north/utilities";

const value = 1000.99;

console.log(
    formatPrice(value, {
        minimumFractionDigits: 0,
        maximumFractionDigits: 0
    })
); // -> "$1,001"

doesKeyExists

import { doesKeyExists } from "@44north/utilities";

const obj = { foo: "bar" };

console.log(doesKeyExists(obj, "foo")); // -> true

slugify

import { slugify } from "@44north/utilities";

const value = "Foo Bar Baz";

console.log(slugify(value)); // -> foo-bar-baz

isValidEmailAddress

import { isValidEmailAddress } from "@44north/utilities";

const value = "Foo Bar Baz";

console.log(isValidEmailAddress(value)); // -> false
console.log(isValidEmailAddress("[email protected]")); // -> true

asBool

import { asBool } from "@44north/utilities";

const value = "True";

console.log(asBool(value)); // -> true: boolean

sortObjectArrayByKey

import { sortObjectArrayByKey } from "@44north/utilities";

const startingData = [
    {
        label: "1/2",
        value: "50"
    },
    {
        label: "1",
        value: "100"
    },
    {
        label: "1/4",
        value: "25"
    }
];

// SORT BY LABEL KEY ASC
const sortedDataDesc = sortObjectArrayByKey(startingData, "label");
console.log(sortedDataDesc.map((o) => o.value).join(",")); // -> 100,50,25

// SORT BY LABEL KEY DESC
const sortedDataDesc = sortObjectArrayByKey(startingData, "label", "desc");
console.log(sortedDataDesc.map((o) => o.value).join(",")); // -> 25,50,100

// SORT BY VALUE WITH A FUNCTION
const sortedDataCustom = sortObjectArrayByKey(startingData, "value", (a, b) => {
    if (Number(a) < Number(b)) {
        return -1;
    }
    if (Number(a) > Number(b)) {
        return 1;
    }
    return 0;
});
console.log(sortedDataCustom.map((o) => o.value).join(",")); // -> 25,50,100

startsWith

returns a boolean if the provided value contains the provided condition string.

import { startsWith } from "@44north/utilities";

const value = "foobar";
if (startsWith(value, "foo")) {
    // it's true!
}

optionally, you can pass RegExp flags as a third parameter. case insensitive is on my default.

endsWith

returns a boolean if the provided value contains the provided condition string.

import { endsWith } from "@44north/utilities";

const value = "foobar";
if (endsWith(value, "bar")) {
    // it's true!
}

optionally, you can pass RegExp flags as a third parameter. case insensitive is on my default.

contains

returns a boolean if the provided value contains the provided condition string.

import { contains } from "@44north/utilities";

const value = "foobar";
if (contains(value, "oba")) {
    // it's true!
}

optionally, you can pass RegExp flags as a third parameter. case insensitive is on my default.

validatePageSlug

returns if all segments of the provided URI are a slug.

import { validatePageSlug } from "@44north/utilities";

console.log(validatePageSlug("/foo/bar/baz")); // -> true
console.log(validatePageSlug("/foo//bar/baz")); // -> false
console.log(validatePageSlug("/foo/bar baz")); // -> false