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

jalutils

v1.0.1

Published

A collection of utility functions for JavaScript and TypeScript.

Readme

jalutils

npm version License: MIT

A collection of utility functions for JavaScript and TypeScript. Lightweight, tree-shakeable, and fully typed.

Installation

npm install jalutils
pnpm add jalutils
yarn add jalutils

Features

  • 🎯 TypeScript First: Written in TypeScript with full type definitions
  • 🌳 Tree-shakeable: Import only what you need
  • 📦 Zero Dependencies: No external dependencies
  • Lightweight: Minimal bundle size impact
  • 🧪 Well Tested: Comprehensive test coverage
  • 📚 Modular: Import specific categories or individual functions

Docs

Read the full docs and API reference on here

Usage

Import Everything

import { debounce, flatten, isNil, unix } from "jalutils";

Import by Category

import { debounce, throttle } from "jalutils/function";

Examples

Debouncing Search Input

import { debounce } from "jalutils/function";

// Debounce search to avoid excessive API calls
const searchProducts = debounce((query: string) => {
  fetch(`/api/search?q=${query}`)
    .then((res) => res.json())
    .then((data) => console.log(data));
}, 300);

// In your component
searchInput.addEventListener("input", (e) => {
  searchProducts(e.target.value);
});

Working with Arrays and Type Checking

import { flatten, intersection } from "jalutils/array";
import { isNil } from "jalutils/type";

// Flatten nested data structures
const categories = [
  ["electronics", ["phones", "laptops"]],
  ["clothing", ["shirts", "pants"]],
];
const allCategories = flatten(categories);
// ['electronics', 'phones', 'laptops', 'clothing', 'shirts', 'pants']

// Find common elements
const userTags = ["javascript", "typescript", "react"];
const jobTags = ["typescript", "react", "node"];
const matchingSkills = intersection(userTags, jobTags);
// ['typescript', 'react']

// Safe property access
function getUserEmail(user: { email?: string } | null) {
  if (isNil(user) || isNil(user.email)) {
    return "[email protected]";
  }
  return user.email;
}

API Reference

Array

| Function | Signature | Description | | -------------- | ---------------------------------------- | ------------------------------------------ | | flatten | flatten<T>(array: T[]): T[] | Flattens nested arrays into a single array | | intersection | intersection<T>(...arrays: T[][]): T[] | Returns values present in all arrays | | union | union<T>(...arrays: T[][]): T[] | Combines arrays into unique values | | sample | sample<T>(array: T[]): T | Returns a random element from an array |

Function

| Function | Signature | Description | | ---------- | ---------------------------------------------------------------------- | ----------------------------------------------------------- | | debounce | debounce<T>(func: T, wait: number): (...args: Parameters<T>) => void | Delays function execution until after a specified wait time | | throttle | throttle<T>(func: T, wait: number): (...args: Parameters<T>) => void | Limits function execution to once per specified interval | | memoize | memoize<T>(func: T): (...args: Parameters<T>) => ReturnType<T> | Caches function results based on arguments |

Type

| Function | Signature | Description | | ------------- | --------------------------------------------------- | ------------------------------------------ | | isNil | isNil(value: unknown): value is null \| undefined | Checks if a value is null or undefined | | isNull | isNull(value: unknown): value is null | Checks if a value is null | | isUndefined | isUndefined(value: unknown): value is undefined | Checks if a value is undefined |

Date

| Function | Signature | Description | | -------- | ---------------------------------------------- | ------------------------------------------------------- | | unix | unix(date: Date \| string \| number): number | Converts a date to Unix timestamp (seconds since epoch) |

String

| Function | Signature | Description | | ------------ | --------------------------------- | ---------------------------------------- | | capitalize | capitalize(str: string): string | Capitalizes the first letter of a string |

Development

pnpm install  # Install dependencies
pnpm test     # Run tests
pnpm build    # Build package
pnpm dev      # Run development server

Contributing

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

License

MIT © Jalu Wibowo Aji

Author

Jalu Wibowo Aji

Repository

https://github.com/jarooda/jalutils