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

@deveko/utils

v1.3.0

Published

Lightweight utility functions for every day JavaScript tasks

Readme

@deveko/utils

Lightweight utility functions for everyday JavaScript tasks. Built and maintained by Deveko.


🚀 Installation

npm install @deveko/utils

Usage

ESM

import { string, number } from "@deveko/utils";

console.log(string.kebabCase("Yoooo Whats      up my-';'.'.'.'.|bro"));
// yoooo-whats-up-my-bro

console.log(number.gcd(101, 10));
// 1

console.log(array.chunk([1, 2, 3, 4, 5], 2));
// [[1,2],[3,4],[5]]

const users = [
  { name: "Alice", age: 25 },
  { name: "Bob" }, // age missing
  { name: "Charlie", age: 28 },
];
console.log(array.pluck(users, "name"));
// ["Alice", "Bob", "Charlie"]

console.log(array.compact([false, null, 0, "", undefined, NaN, "hello", 42]));
// ['hello', 42]

CJS

const { string, number } = require("@deveko/utils");

console.log(string.kebabCase("Yoooo Whats      up my-';'.'.'.'.|bro"));
// yoooo-whats-up-my-bro

console.log(number.gcd(101, 10));
// 1

console.log(array.chunk([1, 2, 3, 4, 5], 2));
// [[1,2],[3,4],[5]]

const users = [
  { name: "Alice", age: 25 },
  { name: "Bob" }, // age missing
  { name: "Charlie", age: 28 },
];
console.log(array.pluck(users, "name"));
// ["Alice", "Bob", "Charlie"]

console.log(array.compact([false, null, 0, "", undefined, NaN, "hello", 42]));
// ['hello', 42]

🔧 Available Functions

string

  • capitalize(str) → makes the first letter uppercase, rest lowercase
  • camelCase(str) → converts "hello world_test" → "helloWorldTest"
  • kebabCase(str) → converts "Hello World" → "hello-world"
  • truncate(str, length) → shortens a string with "..." if too long

number

  • isEven(num) → Returns true if a number is even.
  • isOdd(num) → Returns true if a number is odd.
  • clamp(num, min, max) → Restricts a number to stay within a given range.
  • toFixed(num, decimals) → Rounds a number to a specified number of decimal places.
  • roundToNearest(num, step) → Rounds a number to the nearest multiple of a given step.
  • randomInt(min, max) → Returns a random integer between min and max (inclusive).
  • randomFloat(min, max) → Returns a random decimal number between min and max.
  • average(...nums) → Calculates the average of multiple numbers.
  • sum(...nums) → Calculates the sum of multiple numbers.
  • gcd(a, b) → Returns the greatest common divisor (HCF) of two numbers.
  • lcm(a, b) → Returns the least common multiple of two numbers.
  • factorial(n) → Returns the factorial of a non-negative integer.
  • isPrime(n) → Returns true if a number is prime.

array

  • first(arr) → Returns the first element of an array.
  • last(arr) → Returns the last element of an array.
  • flatten(arr) → Flattens nested arrays into a single-level array.
  • unique(arr) → Removes duplicate values from an array.
  • chunk(arr, size) → Splits an array into smaller arrays of given size.
  • shuffle(arr) → Randomly shuffles the elements of an array.
  • sumArray(arr) → Returns the sum of all numbers in an array.
  • contains(arr, value) → Checks if an array contains a value.
  • remove(arr, value) → Removes all occurrences of a value from an array.
  • pluck(arr, key) → Extracts a property from objects in an array.
  • range(start, end, step) → Creates an array of numbers from start up to (but not including) end, stepping by step.
  • compact(arr) → Removes all falsy values (false, 0, '', null, undefined, NaN) from an array.
  • intersection(arr1, arr2) → Returns a new array of values that appear in both input arrays.
  • difference(arr1, arr2) → Returns values from arr1 that are not present in arr2.
  • sortNumeric(arr, order) → Sorts an array of numbers in ascending or descending order.

📦 Versioning

This project follows Semantic Versioning.

  • PATCH Bug fixed only (1.0.1 1.0.2).
  • MINOR Backward-compatible new features (1.0.0 1.1.0).
  • MAJOR Breaking changes (1.0.0 2.0.0).

🫱🏽‍🫲🏽 Contributing

NOT AVAILABLE YET


📜 License

MIT © 2025 Deveko


📝 CHANGELOG.md

# Changelog

All notable changes to this project will be documented here.

## 1.3.0 - 2025-08-23

- Added Array utilities
- Added `first` function
- Added `last` function
- Added `flatten` function
- Added `unique` function
- Added `chunk` function
- Added `shuffle` function
- Added `sumArray` function
- Added `contains` function
- Added `remove` function
- Added `pluck` function
- Added `range` function
- Added `compact` function
- Added `intersection` function
- Added `difference` function
- Added `sortNumeric` function

## 1.2.0 - 2025-08-23

- Added Number utilities
- Added `isEven` function
- Added `isOdd` function
- Added `clamp` function
- Added `toFixed` function
- Added `roundToNearest` function
- Added `randomInt` function
- Added `randomFloat` function
- Added `average` function
- Added `sum` function
- Added `gcd` function
- Added `lcm` function
- Added `factorial` function
- Added `isPrime` function

## 1.1.2 - 2025-08-23

- Edited `README.md` and `CHANGELOG.md`

## 1.1.1 - 2025-08-23

- Fixed error by renaming `commonjs` files to use `.cjs`

## 1.1.0 - 2025-08-23

- Removed `isEven` function
- Removed `chunk` function
- Added `camelCase` function
- Added `kebabCase` function
- Added `truncate` function
- Refactored Package folder structure
- Added support for both `commonjs` and `ESM`

## 1.0.1 - 2025-08-22

- Edited `README.md` and `CHANGELOG.md`

## 1.0.0 - 2025-08-22

- Initial release 🚀
- Added `capitalize` function
- Added `isEven` function
- Added `chunk` function