@lvchengbin/map

An implementation of Map in JavaScript for browsers.

Stats

StarsIssuesVersionUpdatedCreatedSize
@lvchengbin/map
010.0.133 years ago3 years agoMinified + gzip package size for @lvchengbin/map in KB

Readme

Map

An implementation of Map in JavaScript for browsers. Supporting methods of Map in ES6.

Usage

$ npm i @lvchengbin/map --save
import Map from '@lvchengbin/map';
const map = new Map( [ [ 'x', 1 ], [ 'y', 2 ] ] );
map.set( {}, 3 );

The native Map will be used if the client supports native Map and if the second argument of Map constructor is not false.

If you want to use the library in browsers that loading with <SCRIPT> tag, you can git it from map.js, and for browsers do not support ES6, please use map.bc.js.

<script src="./map.bc.js"></script>
<script>
var map = new Map( [ [ 'x', 1 ], [ 'y', 2 ] ] );
console.log( map.size );
</script>

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.