Socket
Book a DemoInstallSign in
Socket

hifile

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hifile

generate markup for highlight.js file viewer

latest
Source
npmnpm
Version
2.1.1
Version published
Maintainers
1
Created
Source

hifile

Generate file viewer markup for highlighted strings from highlight.js

hifile output

Live demo of example output available on rawgit.com.

Usage

var hifile = require('hifile');

var str = fs.readFileSync(path.join(__dirname, 'example.js'), 'utf8');
var markup = hifile(str, 'js');

Presentation and behaviour are provided via:

  • assets/css/hifile.css
  • assets/js/hifile.js with
  • assets/css/hljs-theme-*.css for highlight theming

When served to the browser with the markup, line numbers and line highlighting will be available.

Keywords

highlight

FAQs

Package last updated on 13 Dec 2017

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