Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

illuminate-js

1.0.0-alpha.2 • Public • Published

Illuminate JS

NPM Version Dependency Status Dev Dependency Status

Illuminate is a syntax highlighter, based on the well known prism.js, rewritten from the ground up in ES6 to be used with projects like markdown-it, gatsby, react, etc.

How is it different from Prism?

  • No need of including a client side library, just for highlighting the code snippets (when used with markdown-it and gatsby).
  • Uses ES6 Maps to ensure the order in language definitions.
  • react-illuminate works in the "react way". No need for dangerouslySetInnerHTML.

Install

npm install --save illuminate-js

Usage

Before you can use the highlighter, you will need to add the languages defintions you want to use, as shown below. This helps in keeping the bundle size down.

import { addLanguage, highlight } from 'illuminate-js';
 
// for example, if you want to highlight 'javascript'
import { javascript } from 'illuminate-js/lib/languages';
 
addLanguage('javascript', javascript);
 
// You can alias it too.
addLanguage('js', javascript);
 
highlight('Your code goes here', 'js');

License

MIT. Copyright(c) Vivek Kumar Bansal

Keywords

none

install

npm i illuminate-js

Downloadsweekly downloads

18

version

1.0.0-alpha.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability