How To Install nodejs-keypress on CentOS 7

In this tutorial we learn how to install nodejs-keypress on CentOS 7. nodejs-keypress is Make any Node ReadableStream emit keypress events

Introduction

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

What is nodejs-keypress

Previous to Node v0.8.x, there was an undocumented “keypress” event that process.stdin would emit when it was a TTY. Some people discovered this hidden gem, and started using it in their own code. In Node v0.8.x, this “keypress” event does not get emitted by default, but rather only when it is being used in conjunction with the readline (or by extension, the repl) module. This module is the exact logic from the node v0.8.x releases ripped out into its own module.

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

Install nodejs-keypress 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-keypress using yum by running the following command:

sudo yum -y install nodejs-keypress

Install nodejs-keypress 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-keypress using dnf by running the following command:

sudo dnf -y install nodejs-keypress

How To Uninstall nodejs-keypress on CentOS 7

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

sudo dnf remove nodejs-keypress

References

Summary

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