Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hamt_plus

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hamt_plus

Fork of HAMT that adds transient mutation and support for custom key types

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
214K
decreased by-58.08%
Maintainers
1
Weekly downloads
 
Created

What is hamt_plus?

The hamt_plus npm package provides a high-performance, immutable hash array mapped trie (HAMT) implementation. It is designed for efficient storage and retrieval of key-value pairs, supporting operations like insertion, deletion, and lookup in a way that ensures immutability.

What are hamt_plus's main functionalities?

Creating a new HAMT

This feature allows you to create a new, empty HAMT. The `make` function initializes an empty hash array mapped trie.

const hamt = require('hamt_plus');
const map = hamt.make();

Inserting a key-value pair

This feature allows you to insert a key-value pair into the HAMT. The `set` method returns a new HAMT with the key-value pair added, ensuring immutability.

const hamt = require('hamt_plus');
let map = hamt.make();
map = map.set('key', 'value');

Retrieving a value by key

This feature allows you to retrieve a value by its key from the HAMT. The `get` method returns the value associated with the specified key.

const hamt = require('hamt_plus');
let map = hamt.make();
map = map.set('key', 'value');
const value = map.get('key');

Deleting a key-value pair

This feature allows you to delete a key-value pair from the HAMT. The `delete` method returns a new HAMT with the specified key-value pair removed.

const hamt = require('hamt_plus');
let map = hamt.make();
map = map.set('key', 'value');
map = map.delete('key');

Checking for a key

This feature allows you to check if a key exists in the HAMT. The `has` method returns a boolean indicating whether the key is present.

const hamt = require('hamt_plus');
let map = hamt.make();
map = map.set('key', 'value');
const hasKey = map.has('key');

Other packages similar to hamt_plus

Keywords

FAQs

Package last updated on 16 Mar 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc