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

lv-ts-utils

v0.0.2

Published

Lightweight TypeScript utility kit with small, focused helpers for type guards, strings, arrays, and timing helpers. Published as ESM with bundled type definitions.

Readme

lv-ts-utils

Lightweight TypeScript utility kit with small, focused helpers for type guards, strings, arrays, and timing helpers. Published as ESM with bundled type definitions.

Installation

npm install lv-ts-utils
# or
yarn add lv-ts-utils
# or
pnpm add lv-ts-utils

Quick start

import { isString, debounce, capitalize } from "lv-ts-utils";

const logTyped = debounce((value: unknown) => {
	if (isString(value)) {
		console.log(capitalize(value));
	}
}, 300);

logTyped("hello world"); // → "Hello World"

API

Types

  • AnyFunction: alias for (...args: unknown[]) => unknown, used by timing helpers.

Check

  • isEmpty(value: unknown): boolean — returns true for non-objects and for objects with no enumerable entries.
  • isNullOrUndefined(value): value is null | undefined — narrow to nullable values.
  • isObject(value): value is object — plain object guard (excludes null, arrays, Date, RegExp).
  • isString(value): value is string — string guard.

Strings

  • capitalize(string): string — capitalizes the first letter of each space-separated word; if input is not a string, returns it unchanged.
  • includes(string, substring): boolean — safe wrapper around String.prototype.includes; returns false if either argument is not a string.

Arrays

  • arraylable(value): T[] — ensures an array; returns [] when input is null or not an array.
  • map(array, fn): U[] — thin wrapper over Array.prototype.map for consistent import style.

Timing

  • debounce(fn, delay = 200) — returns a debounced function that runs after inactivity for the given delay (default 200 ms).
  • throttle(fn, delay = 500) — returns a throttled function that runs at most once per delay window (default 500 ms).

Test helpers

  • hello() — logs Hello, world!.

Project scripts

  • npm run build — type-check with tsc and build with vite.
  • npm run lint — lint with Biome.
  • npm run format — format with Biome.
  • npm run check:types — Biome check plus tsc --noEmit.
  • npm test — run Vitest with coverage.
  • npm run test:mutation — run Stryker mutation tests.

Output

  • Entry point: dist/ts-utils.js.
  • Types: dist/types/index.d.ts.