JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 8961
  • Score
    100M100P100Q7835F
  • License MIT

A simple wrapper around Python's Pygments code formatter, with Pygments bundled

Package Exports

  • pygmentize-bundled
  • pygmentize-bundled/test

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 (pygmentize-bundled) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Pygmentize (Bundled)

A simple wrapper around Python's Pygments code formatter, with Pygments bundled

Similar to pksunkara's pygments.js but this comes bundled with Pygments so it doesn't need to be installed on your system, you just need to have Python.

Currently the interface is very simple, no additional options:

var pygmentize = require('pygmentize-bundled')

pygmentize('js', 'html', 'var a = "b";', function (err, result) {
  console.log(result.toString())
})

Results in:

<div class="highlight"><pre>
  <span class="kd">var</span>
  <span class="nx">a</span>
  <span class="o">=</span>
  <span class="s2">&quot;b&quot;</span>
  <span class="p">;</span>
</pre></div>

API

pygmentize(lang, format, code, callback)

Refer to the Pygments documentation. For supported languages, see the list of lexers, for supported formatted, see the list of formatters.

Pygments (Bundled) is Copyright (c) 2012 Rod Vagg <@rvagg> and licenced under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.

Pygments is licenced under the BSD licence.