Basic Usage

Use Case

BetterMap is just an extension of the built-in Map class from JavaScript.

Example with sorting

import Pokemon from "[email protected]/testdata/pokemon.json" assert {
  type: "json",
import { BetterMap } from "";

interface PokemonData {
  name: string;
  id: number;
  tier: string;

const b = new BetterMap<string, PokemonData>("Pokemon");
for (const pokemon of Pokemon) {
  b.set(`${}`, pokemon);

// The sort() method allows sorting a map. 
// It returns the Map instance to allow chaining methods.

  b.sort((a, b) =>,
Edit this page on GitHub Updated at Thu, Aug 4, 2022