@amaui/hash-table
Version:
106 lines (74 loc) • 1.58 kB
Markdown
</br >
</br >
<p align='center'>
<a target='_blank' rel='noopener noreferrer' href='#'>
<img src='utils/images/logo.svg' alt='amaui logo' />
</a>
</p>
<h1 align='center'>amaui Hash table</h1>
<p align='center'>
Hash table
</p>
<br />
<h3 align='center'>
<sub>MIT license </sub>
<sub>Production ready </sub>
<sub>UMD 1.5kb gzipped </sub>
<sub>100% test cov </sub>
<sub>Browser and Nodejs</sub>
</h3>
<p align='center'>
<sub>Very simple code </sub>
<sub>Modern code </sub>
<sub>Junior friendly </sub>
<sub>Typescript </sub>
<sub>Made with :yellow_heart:</sub>
</p>
<br />
## Getting started
### Add
```sh
// yarn
yarn add @amaui/hash-table
// npm
npm install @amaui/hash-table
```
### Use cases
- Indexing data
- Caching
- Storage for data, for efficient quering
- Storing relationships between data
- etc.
### Use
```javascript
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
```sh
yarn
```
Test
```sh
yarn test
```
### Prod
Build
```sh
yarn build
```
### Docs
Might be soon...