Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

weak-value-map

0.2.0 • Public • Published

weak-value-map

A collection of key/value pairs in which the values are weakly referenced.

Install

$ npm install weak-value-map

Usage

Initialization

'use strict';
var WeakValueMap = require('weak-value-map');
 
var map = new WeakValueMap();

Insertion / Deletion

map.set(1, "abcd")
   .set(2, "efg")
   .set(3, "hijk");
 
map.delete(2);

Retrieval

map.get(1);
// => "abcd"
 
map.get(2);
// => undefined
 
map.get(3);
// => "hijk"

License

MIT

Keywords

none

install

npm i weak-value-map

Downloadsweekly downloads

23

version

0.2.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar