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

utilifyx

v0.2.1

Published

A modern, lightweight utility toolkit for JavaScript & TypeScript

Readme


📦 utilifyx

A modern, lightweight utility toolkit for JavaScript & TypeScript

utilifyx is a compact, dependency-free utility library offering powerful helpers for:

  • Objects
  • Arrays
  • Strings
  • Async utilities
  • Date utilities
  • Validation

It is designed to be:

  • Lightweight (~4 KB gzipped)
  • Tree-shakable
  • Fully typed (TypeScript)
  • ESM-native
  • Faster and smaller than Lodash

🚀 Why utilifyx?

| Feature | utilifyx | lodash | |--------|----------|--------| | Install size | 7.6 kB | ~1.4 MB | | Bundle size (gzipped) | ~4 KB | ~72 KB | | Tree-shaking | ✔ Yes | ❌ No | | Zero dependencies | ✔ Yes | ❌ No | | TypeScript types | ✔ Built-in | ✔ Yes | | ESM support | ✔ Native | ❌ Legacy |


📥 Installation

npm install utilifyx

or:

yarn add utilifyx

🔧 Quick Start Example

import { deepClone, groupBy, toCamelCase, debounce } from "utilifyx";

const obj = { a: { b: 1 } };
console.log(deepClone(obj));

const items = [
  { category: "fruit", name: "Apple" },
  { category: "fruit", name: "Banana" },
  { category: "veg", name: "Carrot" }
];

console.log(groupBy(items, "category")); 
console.log(toCamelCase("hello_world")); // helloWorld

const fn = debounce(() => console.log("Run!"), 300);
fn();

📚 API Reference

Below is the full API with practical, real-world examples.


🟦 OBJECT UTILITIES

1️⃣ deepClone

import { deepClone } from "utilifyx";

const user = { name: "Alex", address: { city: "NY", zip: 12345 } };
const cloned = deepClone(user);

cloned.address.city = "LA";

console.log(user.address.city);  // NY

2️⃣ deepMerge

import { deepMerge } from "utilifyx";

const a = { user: { name: "Alex" }, roles: ["admin"] };
const b = { user: { age: 25 }, roles: ["editor"] };

console.log(deepMerge(a, b));
// { user: { name: "Alex", age: 25 }, roles: ["admin", "editor"] }

3️⃣ get

import { get } from "utilifyx";

const obj = { user: { profile: { age: 30 } } };

console.log(get(obj, "user.profile.age")); // 30
console.log(get(obj, "user.address.city", "unknown")); // "unknown"

4️⃣ set

import { set } from "utilifyx";

const obj = {};

set(obj, "user.profile.age", 30);

console.log(obj);
// { user: { profile: { age: 30 } } }

5️⃣ isEqual

import { isEqual } from "utilifyx";

console.log(isEqual({ a: 1 }, { a: 1 })); // true
console.log(isEqual({ a: 1 }, { a: 2 })); // false

6️⃣ omit

import { omit } from "utilifyx";

const user = { id: 1, name: "Alex", password: "secret" };

console.log(omit(user, ["password"]));
// { id: 1, name: "Alex" }

7️⃣ pick

import { pick } from "utilifyx";

const user = { id: 1, name: "Alex", email: "[email protected]" };

console.log(pick(user, ["name", "email"]));
// { name: "Alex", email: "[email protected]" }

8️⃣ removeEmptyValues

import { removeEmptyValues } from "utilifyx";

const data = { name: "Alex", age: null, city: undefined };

console.log(removeEmptyValues(data));
// { name: "Alex" }

9️⃣ shallowClone

import { shallowClone } from "utilifyx";

const obj = { a: 1, b: 2 };
console.log(shallowClone(obj));
// { a: 1, b: 2 }

🟩 ARRAY UTILITIES

1️⃣ uniqueBy

import { uniqueBy } from "utilifyx";

const items = [
  { id: 1, name: "A" },
  { id: 1, name: "A" },
  { id: 2, name: "B" }
];

console.log(uniqueBy(items, "id"));
// [{ id: 1, name: "A" }, { id: 2, name: "B" }]

2️⃣ groupBy

import { groupBy } from "utilifyx";

const items = [
  { category: "fruit", name: "Apple" },
  { category: "veg", name: "Carrot" },
  { category: "fruit", name: "Banana" }
];

console.log(groupBy(items, "category"));
// { fruit: [...], veg: [...] }

3️⃣ sortBy

import { sortBy } from "utilifyx";

const users = [
  { name: "Alex", age: 30 },
  { name: "Ben", age: 20 }
];

console.log(sortBy(users, "age"));
// [ { name: "Ben", age: 20 }, { name: "Alex", age: 30 } ]

4️⃣ flatten

import { flatten } from "utilifyx";

console.log(flatten([1, [2, [3, 4]]])); 
// [1, 2, 3, 4]

5️⃣ arrayToMap

import { arrayToMap } from "utilifyx";

const list = [
  { id: 1, name: "A" },
  { id: 2, name: "B" }
];

console.log(arrayToMap(list, "id"));
// { 1: {...}, 2: {...} }

🟧 STRING UTILITIES

1️⃣ toCamelCase

import { toCamelCase } from "utilifyx";

console.log(toCamelCase("hello_world")); // helloWorld
console.log(toCamelCase("my-name-is"));  // myNameIs

2️⃣ toSnakeCase

import { toSnakeCase } from "utilifyx";

console.log(toSnakeCase("HelloWorld")); // hello_world
console.log(toSnakeCase("myNameIs"));   // my_name_is

3️⃣ toKebabCase

import { toKebabCase } from "utilifyx";

console.log(toKebabCase("HelloWorld")); // hello-world

🟨 ASYNC UTILITIES

1️⃣ debounce

import { debounce } from "utilifyx";

const log = debounce(() => console.log("Run!"), 500);

log();
log();
// Only runs once after 500ms

2️⃣ throttle

import { throttle } from "utilifyx";

const run = throttle(() => console.log("Fired!"), 1000);

run();
run();
// Only fires once per second

3️⃣ memoize

import { memoize } from "utilifyx";

const slowAdd = (a, b) => a + b;
const fastAdd = memoize(slowAdd);

console.log(fastAdd(2, 3)); // calculated
console.log(fastAdd(2, 3)); // cached

🟫 DATE UTILITIES

1️⃣ formatDate

import { formatDate } from "utilifyx";

console.log(formatDate(new Date(), "en-US"));
// e.g., "12/10/2025"

2️⃣ parseDate

import { parseDate } from "utilifyx";

console.log(parseDate("2025-12-10"));
// returns Date object

3️⃣ addDays

import { addDays } from "utilifyx";

console.log(addDays(new Date("2025-01-01"), 10));
// Jan 11, 2025

4️⃣ diffDays

import { diffDays } from "utilifyx";

console.log(diffDays("2025-01-10", "2025-01-01"));
// 9

🟪 VALIDATION UTILITIES

1️⃣ validateEmail

import { validateEmail } from "utilifyx";

console.log(validateEmail("[email protected]")); // true
console.log(validateEmail("x@y")); // false

2️⃣ validatePhone

import { validatePhone } from "utilifyx";

console.log(validatePhone("9876543210")); // true
console.log(validatePhone("12345")); // false

3️⃣ isEmpty

import { isEmpty } from "utilifyx";

console.log(isEmpty(""));      // true
console.log(isEmpty([]));      // true
console.log(isEmpty({}));      // true
console.log(isEmpty("text"));  // false

4️⃣ isNumeric

import { isNumeric } from "utilifyx";

console.log(isNumeric("123")); // true
console.log(isNumeric("A12")); // false

🧪 Running Tests

npm test

This runs all Jest test suites with coverage.


🏗 Building the Package

npm run build

Output files will be generated inside:

dist/

🤝 Contributing

Contributions are welcome!

  1. Fork the repository
  2. Create a feature branch
  3. Add your changes + tests
  4. Submit a Pull Request

📄 License

This project is licensed under the MIT License.


⭐ Support the Project

If utilifyx helps you, please:

  • ⭐ Star the GitHub repository
  • ⭐ Star the package on npm
  • Share it with your developer community

Your support helps the project grow!