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

internmap

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

internmap

Map and Set with automatic key interning

  • 2.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7.3M
increased by10.44%
Maintainers
1
Weekly downloads
 
Created

What is internmap?

The internmap npm package provides data structures for interned collections, which are collections that store a single copy of each unique value. This can be useful for memory efficiency and performance when dealing with large datasets with many repeated values. The package includes implementations of maps and sets that use interned keys.

What are internmap's main functionalities?

InternMap

InternMap is a map data structure that automatically interns its keys, ensuring that each key is stored only once in memory, even if it is set multiple times with different values.

{"const InternMap = require('internmap');
const map = new InternMap();
map.set('a', 1);
map.set('b', 2);
console.log(map.get('a')); // 1
console.log(map.has('b')); // true
console.log(map.size); // 2"}

InternSet

InternSet is a set data structure that automatically interns its values, ensuring that each value is stored only once in memory, even if it is added multiple times.

{"const InternSet = require('internmap').InternSet;
const set = new InternSet();
set.add('a');
set.add('b');
set.add('a');
console.log(set.has('a')); // true
console.log(set.size); // 2"}

Other packages similar to internmap

FAQs

Package last updated on 20 Sep 2021

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