Socket
Book a DemoInstallSign in
Socket

nanolight

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nanolight

‘nanolight’ is code highlighter for any programming language. Works in both Node.js and the browser. Lightweight. No dependencies.

latest
Source
npmnpm
Version
1.6.21
Version published
Maintainers
1
Created
Source

nanolight

‘nanolight’ is code highlighter for any programming language. Works in both Node.js and the browser. Lightweight. No dependencies.

Install

NPM

npm install nanolight

CDN

<script type="text/javascript" src="https://cdn.rawgit.com/jackens/nanolight/master/nanolight.js"></script>

or

<script type="text/javascript" src="https://cdn.rawgit.com/jackens/nanolight/master/nanolight.min.js"></script>

or

<script type="text/javascript" src="https://unpkg.com/nanolight/nanolight.js"></script>

or

<script type="text/javascript" src="https://unpkg.com/nanolight/nanolight.min.js"></script>

Usage

var nanolight = require('nanolight')

nanolight('var theAnswerToLifeTheUniverseAndEverything = 42')

var elements = document.getElementsByClassName('nl')
for (var i = 0; i < elements.length; i++) {
  elements[i].innerHTML = nanolight(elements[i].innerText)
}

More usage examples can be found at https://jackens.github.io/.

Keywords

highlight

FAQs

Package last updated on 21 Jun 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts