rocky
rocky

Reputation: 7098

nodejs syntax highlighter to terminal in nodejs

For this new nodejs debugger I am working on I would like to colorize the source-code lines that are displayed. Any recommendations on a npm to use?

There are a lot of syntax highlighters out there, but what makes this situations a little different is

  1. The output is a to a terminal; it is not rendered in a browser
  2. I only need to colorize nodejs; so although handling 20 million other languages as well may be cool, it is not needed here and it adds code bloat. (I can handle adding code bloat very well enough on my own, thank you.)

I see node-syntaxhighlighter but the lack of links to a github page or documentation kind of troubles me.

Upvotes: 2

Views: 2915

Answers (2)

AdrieanKhisbe
AdrieanKhisbe

Reputation: 4058

I had the same need to colorize some programs in the terminal, and I fell upon the following package cli-highlight.

Here is the github link: https://github.com/felixfbecker/cli-highlight

Upvotes: 1

rocky
rocky

Reputation: 7098

Starting with release 0.1.5 I use consolehighlighter.

Upvotes: 1

Related Questions