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

utilytieslibrary

v0.0.2

Published

This library provides a collection of utility functions for common JavaScript tasks. It was created by Seba Morgado for a TP Level UP course.

Readme

Utilities Library

This library provides a collection of utility functions for common JavaScript tasks. It was created by Seba Morgado for a TP Level UP course.

Installation

Install the library using npm:

Bash/zsh

npm i utilitieslibrary

License

This library is distributed under the FREE license.

Functions

The library includes the following functions:

arraylable(value: unknown[] | null): unknown[] Checks if a value is an array and returns it. If not, returns an empty array. map<T, U>(array: T[], fn: (element: T) => U): U[] Applies a function to all elements of an array and returns a new array with the results. sum(data: number[]): number Calculates the sum of all elements in a number array. isEmpty(value: unknown): boolean Checks if a value is empty (null, undefined, empty string, or empty object). isNullOrUndefined(value: unknown): value is NullOrUndefined Determines if a value is null or undefined. isObjectLike(value: unknown): value is GenericObject Checks if a value is an object-like type (not Date, RegExp, or Array). isObject(value: unknown): boolean Checks if a value is a plain object (not null, array, function, etc.). obscureEmail(email: string): string Obscures an email address by replacing most characters in the username with asterisks. getEnvironmentVariable(environmentVariable: string): string Retrieves an environment variable and throws an error if not found. getEnvironmentVariablesFromArray(environmentVariables: string[]): Record<string, string> Retrieves multiple environment variables from an array and throws an error if any are not found. addHttpsProtocol(url: string): string Adds "https://" to a URL if it does not already have a protocol (http:// or https://). isLinkHttps(url: string): boolean Checks if a URL starts with "https://". formatCurrency(num: number = 0, decimals: number = 2, withSign: boolean = true): string Formats a number as currency with a specific number of decimal places and an optional sign. formatCurrencyIntDecimals(num: number = 0, decimals: number = 2, withSign: boolean = true, showZeros: boolean = true): string Formats a number as currency with a specific number of decimal places, an optional sign, and control over trailing zeros. splitAmountToInput(value: string): { numbers: string; decimals: string } Splits a currency string into separate "numbers" and "decimals" parts. formatAmount(value: string | number): string Removes leading zeros and the decimal point from a string representation of a number. dottedNumber(value: string): string Removes any decimal point from a string representation of a number. formatAmountInput(value?: string | null): { defaultNumber: string; defaultDecimals: string } Formats a currency input value, handling various edge cases. extractCurrencyOfString(msg: string): string[] | null Extracts all currency matches from a string using a regular expression. formatAmountRow(value: number): string Formats a number for display in a table row, including sign and thousands separators. amountWithoutSign(amount: number): string Removes the plus or minus sign from a number. capitalize(s: string): string Capitalizes the first letter of each word in a string. includes(stringValue: string, searchableValue: string): boolean Checks if a string includes a substring (case-sensitive). throttle(fn: T, delay: number = 500): (...args: Parameters) => void Creates a throttled function that can only be called once within a specified delay period. debounce(fn: T, delay: number): (...args: Parameters) => void Creates a debounced function that delays execution until after a specified period of inactivity.