How To Install nodejs-weak-map on CentOS 7

In this tutorial we learn how to install nodejs-weak-map on CentOS 7. nodejs-weak-map is A WeakMap shim for Node.js and browsers

Introduction

In this tutorial we learn how to install nodejs-weak-map on CentOS 7.

What is nodejs-weak-map

WeakMap is a collection introduced to JavaScript with EcmaScript 6. It provides a mapping from objects to values, but allows any entry to be garbage collected if the key is provably lost. In order for it to be possible that a key is provably lost, weak maps do not provide a way to access the key list. This is a Node.js module that provides a shim and patcher for missing or broken WeakMap implementations, suitable for use in Node.js and browsers that provide the EcmaScript 5 property description interfaces.

We can use yum or dnf to install nodejs-weak-map on CentOS 7. In this tutorial we discuss both methods but you only need to choose one of method to install nodejs-weak-map.

Install nodejs-weak-map on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

After updating yum database, We can install nodejs-weak-map using yum by running the following command:

sudo yum -y install nodejs-weak-map

Install nodejs-weak-map on CentOS 7 Using dnf

If you don’t have dnf installed you can install DNF on CentOS 7 first. Update yum database with dnf using the following command.

sudo dnf makecache

After updating yum database, We can install nodejs-weak-map using dnf by running the following command:

sudo dnf -y install nodejs-weak-map

How To Uninstall nodejs-weak-map on CentOS 7

To uninstall only the nodejs-weak-map package we can use the following command:

sudo dnf remove nodejs-weak-map

References

Summary

In this tutorial we learn how to install nodejs-weak-map on CentOS 7 using yum and dnf.