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

@ludeschersoftware/list

v1.1.0

Published

A lightweight, strongly-typed collection class for TypeScript that extends native array functionality with a rich set of utility methods

Readme

A lightweight, strongly-typed collection class for TypeScript that extends native array functionality with a rich set of utility methods. Inspired by .NET’s List<T> and LINQ, this package offers expressive APIs for querying, transforming, and managing data — all with full type safety and zero runtime dependencies.


✨ Features

  • 🔍 Querying: Where, Select, Find, Any, All, Contains, IndexOf
  • 🔄 Modification: Add, AddRange, Insert, Remove, RemoveAll, RemoveAt, Clear, Reverse
  • 🧠 Custom Equality: Pass a comparer function for deep equality or custom logic
  • 🔁 Iteration: Fully iterable with for...of and generator support
  • 🧪 Functional Utilities: First, Last, FirstOrDefault, LastOrDefault, ForEach, Clone, ToArray, IterateReverse
  • 🧼 Transformations: Distinct, Sort, Select, Where
  • 100% Test Coverage: Built with Jest and tested across all branches, edge cases, and behaviors

📦 Installation

npm install @ludeschersoftware/list

Or with Yarn:

yarn add @ludeschersoftware/list

🛠️ Usage

import List from '@ludeschersoftware/list';

const numbers = new List<number>([1, 2, 3, 4]);

numbers.Add(5).Remove(2);

const evens = numbers.Where(n => n % 2 === 0);

console.log(evens.ToArray()); // [4]

const layers = new List<string>(['Background', 'Midground', 'Foreground']);

for (const layer of layers.IterateReverse()) {
    console.log(layer); // Foreground, Midground, Background
}

🧩 Comparer Support

You can pass a custom comparer to handle deep equality:

const people = new List([{ id: 1 }, { id: 2 }], (a, b) => a.id === b.id);
console.log(people.Contains({ id: 1 })); // true

🧪 Testing

This project uses Jest for unit testing. To run tests:

yarn test

To check coverage:

yarn test:coverage

✅ 100% coverage across statements, branches, functions, and lines.


📚 API Overview

| Method | Description | |---------------------|--------------------------------------------------| | Add(item) | Adds an item to the list | | AddRange(items) | Adds multiple items | | Insert(index, item) | Inserts item at index | | Remove(item) | Removes first matching item | | RemoveAll(callback) | Removes all items matching predicate | | RemoveAt(index) | Removes item at index | | Clear() | Empties the list | | Reverse() | Reverses the list | | Contains(item) | Checks if item exists | | IndexOf(item) | Returns index of item | | Find(callback) | Finds first matching item | | Any(callback?) | Checks if any item matches (or if list is non-empty) | | All(callback) | Checks if all items match | | First(callback?) | Returns first item (or first matching) | | Last(callback?) | Returns last item (or last matching) | | FirstOrDefault(callback?, default) | Returns first or default | | LastOrDefault(callback?, default) | Returns last or default | | Get(index) | Gets item at index | | Set(index, value) | Sets item at index | | Where(callback) | Filters items | | Select(selector) | Maps items to new type | | Distinct() | Removes duplicates | | Sort(comparer?) | Sorts items | | ForEach(callback) | Executes callback for each item | | ToArray() | Returns a shallow copy of the list | | Clone() | Returns a deep copy of the list | | Items() | Lazily iterates items in order | | Iterate() | Lazily iterates items in order | | IterateReverse() | Lazily iterates items in reverse order |


Contributing

  1. Fork the repo
  2. Create a feature branch
  3. Add tests under tests/
  4. Submit a PR

License

MIT © Johannes Ludescher


🏁 Final Word

List is more than just a utility — it’s a declaration of clean code, strong typing, and obsessive testing. Whether you’re building a backend service or a frontend app, this collection class will keep your data logic elegant and predictable.

Enjoy it. Extend it. Break it. And if you do — write a test for it 😉