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

oikahm

v0.3.4

Published

Order-Invariant Key-Agnostic Hash Map

Downloads

751

Readme

Order-Invariant Key-Agnostic Hash Map (OIKAHM)

Build Status Build Size Version Downloads

Overview

OIKAHM is a JavaScript implementation of a flexible and efficient hash map that supports order-invariant, composite keys. Unlike traditional hash maps that depend on a single key or the order of elements in multi-part keys, OIKAHM allows you to use complex keys, such as arrays or objects, without worrying about their order. This makes it an ideal choice for scenarios where key order should not affect lookups, ensuring consistent and predictable behavior.

Features

  • Order Invariance: Keys can be passed in any order, and OIKAHM will treat them as equivalent.
  • Key Agnosticism: Supports various key structures, including arrays (['a', 'b', 'c']) and objects ({a: 'AA', b: 'BB', c: 'CC'}).
  • Efficient Lookup: Provides fast access, insertion, and deletion operations for composite keys.
  • Customizable Hashing: Uses a default hashing mechanism but can be extended with custom hash functions to fit specific use cases.

Installation

Install OIKAHM using NPM, PNPM, or your favorite package manager:

npm add oikahm
# or
pnpm add oikahm
import { default as HashMap } from "oikahm";
const hashMap = new HashMap();
// String Key
hashMap.set("A Key", 2314);
console.log(hashMap.get("A Key")); // $ > 2314
console.log(hashMap.get("Another Key")); // $ > undefined
import { default as HashMap } from "oikahm";
const hashMap = new HashMap();
// Array Key
hashMap.set(["Key 1", "Key 2"], 2314);
// Order-Invariant Access
console.log(hashMap.get(["Key 1", "Key 2"])); // $ > 2314
console.log(hashMap.get(["Key 2", "Key 1"])); // $ > 2314
console.log(hashMap.get(["Key 1", "Key 2", "Key 3"])); // $ > undefined
import { default as HashMap } from "oikahm";
const hashMap = new HashMap();
// Object Key
hashMap.set({ key1: "val1", key2: "val2" }, 2314);
// Order-Invariant Access
console.log(hashMap.get({ key1: "val1", key2: "val2" })); // $ > 2314
console.log(hashMap.get({ key2: "val2", key1: "val1" })); // $ > 2314
console.log(hashMap.get({ key1: "val1", key2: "val2", key3: "val3" })); // $ > undefined

Contributing

Contributions are welcome! Feel free to open an issue or submit a pull request with improvements, bug fixes, or new features.

License

This project is licensed under the MIT License.