JSPM

  • Created
  • Published
  • Downloads 9239229
  • Score
    100M100P100Q213526F

A node clone of highlight.js syntax highlighter library

Package Exports

  • highlight.js
  • highlight.js/package.json

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (highlight.js) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Highlight.js

Highlight.js is a node.js fork of highlight.js for the browser.

##Install

npm install highlight.js

##Usage

###Auto Language Detection:

var hl = require("highlight.js");
var txt = "var test = 'asdf'";
var html = hl.highlightAuto(txt);
console.log(html.value);

###Pass in Language:

var hl = require("highlight.js");
var txt = "var test = 'asdf'";
var html = hl.highlight('javascript', txt);
console.log(html.value);

##Example Output:

<span class="keyword">var</span> test = <span class="string">'asdf'</span>