1.1.2 • Published 1 year ago

jshashmap v1.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

A Simple Javascript Utility Library

How To Install

The preferred way to install the jshashmap for Node.js is to use the npm package manager for Node.js. Simply type the following into a terminal:

npm install jshashmap

Examples of Use

Version 1 only support 2 functions:

  • objtToMap(): Convert Javascript object into Javascript Map class
  • arrayToMap(): Convert Javascript object into Javascript Map class
const jshashmap = require("jshashmap");

const foodStocks = {
  apple: 12,
  bread: 20,
  meat: 2,
  vegetable: 35,
};
const hashmap1 = jshashmap.objToMap(foodStocks);
console.log(hashmap1);
// Output:
// Map(4) { 'apple' => 12, 'bread' => 20, 'meat' => 2, 'vegetable' => 35 }

const fruits = ["Apple", "Orange", "Blueberry"];
const hashmap2 = jshashmap.arrayToMap(fruits));
console.log(hashmap2)
// Output:
// Map(3) { 0 => 'Apple', 1 => 'Orange', 2 => 'Blueberry'
1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago