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

pseudomap

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pseudomap

A thing that is a lot like ES6 `Map`, but without iterators, for use in environments where `for..of` syntax and `Map` are not available.

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9.1M
decreased by-26.13%
Maintainers
1
Weekly downloads
 
Created

What is pseudomap?

The pseudomap npm package is a simple implementation of a Map-like data structure that mimics the ES6 Map API. It is designed to be lightweight and provides basic functionalities of a map without adhering strictly to the ES6 specification, making it suitable for environments where a full ES6 implementation is not necessary or desired.

What are pseudomap's main functionalities?

Set and Get

Allows setting a key-value pair and retrieving the value associated with a key.

const PseudoMap = require('pseudomap');
let map = new PseudoMap();
map.set('key', 'value');
console.log(map.get('key')); // Outputs: 'value'

Iteration

Supports iterating over the map using for-of loops to access keys and values.

const PseudoMap = require('pseudomap');
let map = new PseudoMap();
map.set('key1', 'value1');
map.set('key2', 'value2');
for (let [key, value] of map) {
  console.log(key + ': ' + value);
}

Clear

Provides a method to clear all key-value pairs in the map.

const PseudoMap = require('pseudomap');
let map = new PseudoMap();
map.set('key1', 'value1');
map.clear();
console.log(map.size); // Outputs: 0

Other packages similar to pseudomap

FAQs

Package last updated on 05 Jan 2016

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