How to install Highlight.js

Created
Modified

Highlight.js is a syntax highlighter written in JavaScript. It works in the browser as well as on the server. It works with pretty much any markup, doesn’t depend on any framework, and has automatic language detection.

Installation

Cloning a repository

You can clone a repository from GitHub.com to your local computer.
Cloning with HTTPS URLs
git clone https://github.com/highlightjs/highlight.js.git
Cloning with SSH URLs
git clone [email protected]:highlightjs/highlight.js.git
Cloning with GitHub CLI
gh repo clone highlightjs/highlight.js

Install via NPM package

Run the following command to locally install the package and its dependencies with NPM.
Downloading and installing packages locally
npm i highlight.js
npm install highlight.js
yarn add highlight.js
Downloading and installing packages globally
npm i -g highlight.js
yarn global add highlight.js
Install Specific Version of a Package
npm install [email protected]
Bower
bower install highlight.js