New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

fixedsize-map

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fixedsize-map

A simple in memory size cache to hold fixed number of key value pairs

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

About

Fixed Size Map is a Javascript implementation of Map to hold a limited number of keys

Advantages

  • Simple to use cache
  • Lightweight

Installation

npm i fixedsize-map

Usage

const FixedSizeMap = require("fixedsize-map");

const cache = new FixedSizeMap(100);

// Adding elements to cache
cache.add("k1", "Some Value");
cache.add("k2", "Some Value");

Available Methods

MethodDescription
add(k, v)Adds a key and pairs it with a value
contains(k)Checks if this cache contains a key
get(k)Retrieves a value from this cache corresponding to the specified key
remove(k)Removed the key value entry from this cache corresponding to the specified key
clear()Clears the cache

Keywords

cache

FAQs

Package last updated on 18 Feb 2024

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