How To Install node-wcwidth.js on Ubuntu
Posted on April 1, 2023  (Last modified on May 20, 2023 )
2 minutes • 419 words
Introduction
In this tutorial we learn how to install node-wcwidth.js
on Ubuntu.
What is node-wcwidth.js
node-wcwidth.js is:
wcwidth.js is a simple javascript porting of wcwidth() implemented in C by Markus Kuhn.
wcwidth() and its string version, wcswidth() are defined by IEEE Std 1002.1-2001, a.k.a. POSIX.1-2001, and return the number of columns used to represent a wide character and string on fixed-width output devices like terminals. Markus’s implementation assumes wide characters to be encoded in ISO 10646, which is almost true for JavaScript; almost because JavaScript uses UCS-2 and has problems with surrogate pairs. wcwidth.js converts surrogate pairs to Unicode code points to handle them correctly.
Node.js is an event-based server-side JavaScript engine.
There are three methods to install node-wcwidth.js
on Ubuntu. We can use apt-get
, apt
and aptitude
. In the following sections we will describe each method. You can choose one of them.
Install node-wcwidth.js Using apt-get
Update apt database with apt-get
using the following command.
sudo apt-get update
After updating apt database, We can install node-wcwidth.js
using apt-get
by running the following command:
sudo apt-get -y install node-wcwidth.js
Install node-wcwidth.js Using apt
Update apt database with apt
using the following command.
sudo apt update
After updating apt database, We can install node-wcwidth.js
using apt
by running the following command:
sudo apt -y install node-wcwidth.js
Install node-wcwidth.js Using aptitude
If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude
using the following command.
sudo aptitude update
After updating apt database, We can install node-wcwidth.js
using aptitude
by running the following command:
sudo aptitude -y install node-wcwidth.js
How To Uninstall node-wcwidth.js on Ubuntu
To uninstall only the node-wcwidth.js
package we can use the following command:
sudo apt-get remove node-wcwidth.js
Uninstall node-wcwidth.js And Its Dependencies
To uninstall node-wcwidth.js
and its dependencies that are no longer needed by Ubuntu, we can use the command below:
sudo apt-get -y autoremove node-wcwidth.js
Remove node-wcwidth.js Configurations and Data
To remove node-wcwidth.js
configuration and data from Ubuntu we can use the following command:
sudo apt-get -y purge node-wcwidth.js
Remove node-wcwidth.js configuration, data, and all of its dependencies
We can use the following command to remove node-wcwidth.js
configurations, data and all of its dependencies, we can use the following command:
sudo apt-get -y autoremove --purge node-wcwidth.js
Dependencies
node-wcwidth.js have the following dependencies:
References
Summary
In this tutorial we learn how to install node-wcwidth.js
package on Ubuntu using different package management tools: apt, apt-get and aptitude.