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

@lawlzer/utils

v4.0.4

Published

A collection of utilities used to streamline common programming tasks/useful utilities, to help improve code readability and maintainability.

Readme

@lawlzer/utils

A collection of TypeScript utilities designed to streamline common programming tasks. This package provides over 50 well-tested utility functions covering everything from async operations to data manipulation. These utilities are focused on being useful for [me], so I wouldn't necessarily recommend using them. Feel free to steal any of my utilities or use the package if you'd like, though! It is designed to be simple-to-use :)

npm version License: MIT

Features

  • 🚀 50+ Utility Functions - Comprehensive collection for common tasks
  • 📦 Tree-shakeable - Import only what you need
  • 🔧 TypeScript First - Full TypeScript support with proper types
  • 🎯 Zero Dependencies - Minimal footprint (only essential deps)
  • Well Tested - Extensive test coverage
  • 🏗️ ESM & CommonJS - Works everywhere

Installation

npm install @lawlzer/utils
yarn add @lawlzer/utils
pnpm add @lawlzer/utils

Quick Samples

import { sleep, retry, deepCompare, clamp, getRandomCharacters, shuffleArray, getUniques } from '@lawlzer/utils';

// Wait for 2 seconds
await sleep('2s'); // Also accepts numbers: sleep(2000)

// Retry an async operation with timeout
const result = await retry(5000, async () => {
	return await fetchSomeData();
});

// Deep compare objects
const isEqual = deepCompare({ a: 1, b: { c: 2 } }, { a: 1, b: { c: 2 } }); // true

// Clamp a number between min and max
const clamped = clamp(150, 0, 100); // 100

// Generate random string with letters and numbers
const randomStr = getRandomCharacters(10, { letters: true, numbers: true }); // e.g. "a7Bc9Ef2Gh"

// Shuffle an array
const shuffled = shuffleArray([1, 2, 3, 4, 5]); // e.g. [3, 1, 5, 2, 4]

// Get unique values from array
const unique = getUniques([1, 2, 2, 3, 3, 4]); // [1, 2, 3, 4]

Development

Building

# Build for production
npm run build

# Build with watch mode
npm run build:watch

The build process:

  • Generates both ESM (.js) and CommonJS (.cjs) outputs (so the code can be used in /any/ codebase?)
  • Creates TypeScript declarations (.d.ts) (TypeScript!!!)
  • Includes source maps for debugging (can read source code for easier debugging)
  • Tree-shakes unused code
  • Minifies in production mode

Testing

# Run unit tests
npm test

# Run integration tests
npm run test:integration:consumer

Linting

# Run all linters
npm run lint:all

# Run ESLint
npm run lint:eslint

# Run Prettier
npm run lint:prettier

Contributing

Contributions are welcome! Please feel free to submit a Pull Request. Make sure to:

  1. Add tests for new utilities
  2. Update TypeScript types
  3. Add documentation for new functions

Repository

GitHub - Lawlzer/utils

Author

Lawlzer

License

MIT © Kevin Porter