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

arrays-tool

v0.4.0

Published

A simple npm package that provides useful functions for manipulating arrays.

Readme

Arrays Tool

A TypeScript/JavaScript utility library for modern and efficient array operations.

Installation

npm install arrays-tool

Usage

import { ArrayUtils } from 'arrays-tool';

// Example array
const numbers = [1, 2, 3, 4, 5];

// Shuffle array
const shuffled = ArrayUtils.shuffle(numbers);
console.log(shuffled); // [3, 1, 5, 2, 4]

// Reverse array
const reversed = ArrayUtils.reverse(numbers);
console.log(reversed); // [5, 4, 3, 2, 1]

// Get random element
const random = ArrayUtils.random(numbers);
console.log(random); // 3

// Remove duplicates
const withDuplicates = [1, 2, 2, 3, 3, 4];
const unique = ArrayUtils.unique(withDuplicates);
console.log(unique); // [1, 2, 3, 4]

// Merge arrays
const array1 = [1, 2, 3];
const array2 = [3, 4, 5];
const merged = ArrayUtils.merge(array1, array2);
console.log(merged); // [1, 2, 3, 4, 5]

Math Operations

import { ArrayUtils } from 'arrays-tool';

const numbers = [1, 2, 3, 4, 5];

// Calculate sum
const sum = ArrayUtils.sum(numbers);
console.log(sum); // 15

// Calculate average
const avg = ArrayUtils.average(numbers);
console.log(avg); // 3

// Find maximum
const max = ArrayUtils.max(numbers);
console.log(max); // 5

// Find minimum
const min = ArrayUtils.min(numbers);
console.log(min); // 1

// Calculate product
const product = ArrayUtils.product(numbers);
console.log(product); // 120

Features

  • 📦 Zero dependencies
  • 💪 TypeScript support
  • 🚀 High performance
  • 🎯 Tree-shaking support
  • 📝 Comprehensive documentation

API

shuffle<T>(array: T[]): T[]

Shuffles the array and returns a new array.

reverse<T>(array: T[]): T[]

Reverses the array and returns a new array.

random<T>(array: T[]): T

Selects and returns a random element from the array.

unique<T>(array: T[]): T[]

Removes duplicate elements and returns a new array.

merge<T>(array1: T[], array2: T[]): T[]

Merges two arrays and removes duplicate elements.

Math Operations

sum(array: number[]): number

Calculates the sum of all numbers in the array.

average(array: number[]): number

Calculates the average (mean) of all numbers in the array.

max(array: number[]): number

Returns the maximum number in the array.

min(array: number[]): number

Returns the minimum number in the array.

product(array: number[]): number

Calculates the product of all numbers in the array.

License

MIT © [Adem Hatay]