node-prismjs

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

Usage no npm install needed!

<script type="module">
  import nodePrismjs from 'https://cdn.skypack.dev/node-prismjs';
</script>

README

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