node-prismjs

An adapter which make it easier to use Prism in Node.js.


Keywords
prism.js, node.js, adapter
License
MIT
Install
npm install node-prismjs@0.1.0

Documentation

node-prismjs

npm package NPM downloads Dependency Status

An adapter which make it easier to use Prism in Node.js.

Usage

Installation:

npm install --save node-prismjs

In Node.js

const Prism = require('node-prismjs');
function highlight(lang, sourceCode) {
  const language = Prism.languages[lang] || Prism.languages.autoit;
  return Prism.highlight(sourceCode, language);
}

License

MIT