Skip to content

amaui-org/amaui-hash-table

Repository files navigation



amaui logo

amaui Hash table

Hash table


MIT license     Production ready     UMD 1.5kb gzipped     100% test cov     Browser and Nodejs

Very simple code     Modern code     Junior friendly     Typescript     Made with 💛


Getting started

Add

yarn add @amaui/hash-table

Use cases

  • Indexing data
  • Caching
  • Storage for data, for efficient quering
  • Storing relationships between data
  • etc.

Use

  import AmauiHashTable from '@amaui/hash-table';

  // Make a new hash table instance
  const amauiHashTable = new AmauiHashTable();

  // Add values
  amauiHashTable.set('a', 14).set('a1', 114);

  amauiHashTable.get('a');
  // 14

  amauiHashTable.get('a14');
  // undefined

  // Remove
  amauiHashTable.remove('a');
  // true

  amauiHashTable.get('a');
  // undefined

Dev

Install

yarn

Test

yarn test

Prod

Build

yarn build