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

handykit

v0.1.8

Published

Essential toolkit for streamlined JavaScript coding with versatile utility functions

Readme

HandyKit

HandyKit is a versatile utility library designed to streamline your JavaScript projects by providing a comprehensive set of helpful functions. From random number generation to type checking, string formatting, array manipulation, and more, HandyKit simplifies common coding tasks, saving you time and effort. Whether you're a seasoned developer or just starting out, HandyKit's well-crafted functions offer an intuitive and efficient way to enhance your JavaScript codebase with essential utilities.

Helper Functions

sleep(ms: number): Promise<void>

Sleeps the execution of code for the specified time in milliseconds

isOfType(value: any, type: string): boolean

Checks if the given value is of the specified type.

path(filePath: string, path: string): string

Returns the path of a file relative to the specified path.

parseAsBoolean(value: string | boolean): boolean

Parses a value as a boolean. Accepts string representations like "true" or "false".

random(min: number, max: number): number

Generates a random integer between the specified minimum and maximum values.

removeArrayElement<T>(array: T[], element: T): void

Removes a specified element from an array, if it exists.

isObject(value: any): boolean

Checks if a value is an object, excluding arrays and null.

shuffleArray<T>(array: T[]): T[]

Shuffles the elements of an array randomly.

isEmpty<T>(value: T): boolean

Checks if a value is empty or undefined. Supports numbers, strings, arrays, and objects.

uniqueArray<T>(array: T[]): T[]

Removes duplicate elements from an array.

settlePromises<T>(promises: Promise<T>[]): Promise<T[]>

Resolves an array of promises in parallel and returns an array of results which includes the resolved result or undefined if the promise was rejected.

Hotp Class

A class for generating and verifying HOTP (HMAC-based One-Time Password) codes.

Constructor

new Hotp(secret: string, counter: number, options?: HotpOptions)
  • secret: The secret key for generating HOTP codes.
  • counter: The counter value for generating the HOTP code.
  • options: An optional object specifying additional options for HOTP generation.

HotpOptions (all optional)

  • algorithm: "sha1" | "sha256" | "sha512": The hashing algorithm used.
  • alphabet: string: The alphabet used for the password.
  • dashes: boolean | number: If true, the password is dashed.
  • length: number: The length of the password.

Methods

  • password: string: Generates a HOTP password based on the provided secret and counter.
  • verify(password: string): boolean: Verifies if the provided password matches the generated HOTP password.
  • increment(): void: Increments the counter value.
  • static generate(secret: string, counter: number, options?: HotpOptions): string: Generates a HOTP password statically.
  • static verify(secret: string, counter: number, password: string, options?: HotpOptions): boolean: Verifies a HOTP password statically.

Examples

For usage examples of these functions, refer to the ./src/examples.ts file in the HandyKit library repository.