How to install Highlight.js


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.


Cloning a repository

You can clone a repository from to your local computer.
Cloning with HTTPS URLs
git clone
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 install highlight.js