# ohamt

> Ordered Hash array mapped trie

Latest version **0.0.9** (published 2017-04-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install ohamt
pnpm add ohamt
yarn add ohamt
bun add ohamt
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.9 |
| Published | 2017-04-21 |
| First published | 2017-03-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | W.S. Hager |
| Maintainers | wshager |

## Links

- npm: https://www.npmjs.com/package/ohamt
- npm.io page: https://npm.io/package/ohamt

## Recent versions

- 0.0.9 (latest) — 2017-04-21
- 0.0.8 — 2017-04-10
- 0.0.7 — 2017-03-21
- 0.0.6 — 2017-03-17
- 0.0.5 — 2017-03-17
- 0.0.4 — 2017-03-17
- 0.0.3 — 2017-03-08
- 0.0.2 — 2017-03-03
- 0.0.1 — 2017-03-03

## README

# ohamt
Ordered Hash array mapped trie

Forked from https://github.com/mattbierner/hamt_plus

This HAMT maintains insertion order and provides multi-map methods.


## Install
ES6 source code is in `src/ohamt.js`. The library supports node, AMD, and use as a global, as long as your platform supports ES6.
TODO: bablify.

### Node
``` sh
$ npm install ohamt
```

``` javascript
var hamt = require('ohamt');

var h = hamt.empty.set('key', 'value');

...
```

## Extended API (Extends HAMT_PLUS)

#### `map.append(key, value)`
* `value` - Value to store. Hamt supports all value types, including: literals, objects, falsy values, null, and undefined. Keep in mind that only the map data structure itself is guaranteed to be immutable. Using immutable values is recommended but not required.
* `key` - String key.
* `map` - Hamt map.

Returns a new map with the value set. If the key already existed, the entry will be moved to the 'end' of the map. Does not alter the original.

----

#### `map.push(kv)`
* `kv` - Array of String key and Any value to store.
* `map` - Hamt map.

Returns a new map with the value added. If the key already existed, the original entry will not be removed. The new entry will be added to the 'end' of the map. Does not alter the original. The method uses an array to mimic array push.

----

---
_Source: https://npm.io/package/ohamt · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
