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

@js-sdsl/ordered-map

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@js-sdsl/ordered-map

javascript standard data structure library which benchmark against C++ STL

  • 4.2.0-beta.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.5M
decreased by-42.59%
Maintainers
2
Weekly downloads
 
Created

What is @js-sdsl/ordered-map?

@js-sdsl/ordered-map is a JavaScript library that provides an ordered map data structure. This data structure maintains the order of elements based on their keys, allowing for efficient insertion, deletion, and access operations. It is particularly useful for scenarios where the order of elements is important and you need to perform frequent updates.

What are @js-sdsl/ordered-map's main functionalities?

Insertion

This feature allows you to insert key-value pairs into the ordered map. The elements are stored in the order they are inserted.

const { OrderedMap } = require('@js-sdsl/ordered-map');
const map = new OrderedMap();
map.set('a', 1);
map.set('b', 2);
map.set('c', 3);
console.log(map);

Access

This feature allows you to access the value associated with a specific key in the ordered map.

const { OrderedMap } = require('@js-sdsl/ordered-map');
const map = new OrderedMap();
map.set('a', 1);
map.set('b', 2);
map.set('c', 3);
console.log(map.get('b')); // Output: 2

Deletion

This feature allows you to delete a key-value pair from the ordered map based on the key.

const { OrderedMap } = require('@js-sdsl/ordered-map');
const map = new OrderedMap();
map.set('a', 1);
map.set('b', 2);
map.set('c', 3);
map.delete('b');
console.log(map);

Iteration

This feature allows you to iterate over the key-value pairs in the ordered map in the order they were inserted.

const { OrderedMap } = require('@js-sdsl/ordered-map');
const map = new OrderedMap();
map.set('a', 1);
map.set('b', 2);
map.set('c', 3);
for (const [key, value] of map) {
  console.log(key, value);
}

Other packages similar to @js-sdsl/ordered-map

Keywords

FAQs

Package last updated on 06 Nov 2022

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