Socket
Socket
Sign inDemoInstall

hermit

Package Overview
Dependencies
6
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    hermit

Prints html in the terminal using colors and simple layout to reflect the document structure.


Version published
Weekly downloads
1.2K
decreased by-5.64%
Maintainers
1
Install size
1.43 MB
Created
Weekly downloads
 

Readme

Source

hermit build status

Prints html in the terminal using colors and simple layout to reflect the document structure.

Objective

Provide a simple tool to render html in the terminal in a readable format. It is not supposed to replace your browser. The main indended use is to render html snippets, e.g., the ones contained in the descriptions of the json version of the nodejs documentation.

If you want a terminal browser, try lynx instead.

Installation

npm install hermit

Usage

From the Command Line

To use hermit from the command line, you should install it globally:

npm -g install hermit
Rendering a File
hermit filename.html
Piping an Html String

You can pipe the output of any program that produces an html string into hermit.

Example:

curl http://nodejs.org/api/assert.html | hermit

From Your Code

var hermit = require('hermit');
  , html = '<div><h3>Hello from Hermit</h3><p>A little paragraph for you</p></div>';

hermit(html, function (err, res) {
  console.log(res); 
});

Output:

Hello from Hermit           (in green)
-----------------
A little paragraph for you
Custom Options

In order to affect the way that the printed html is layed out and styled, you can pass in custom properties.

These include a stylesheet with the properties outined in the default hermit stylesheet.

var hermit = require('hermit');
  , html = '<div><h3>Hello from Hermit</h3><p>A little paragraph for you</p></div>';
  , myStylesheet = require('./path/to/my/stylesheet.js');

hermit(html, { listIndent: '    ', listStyle: '* ', stylesheet: myStylesheet }, function (err, res) {
  console.log(res); 
});

For more information a detailed example read this hermit test

Keywords

FAQs

Last updated on 01 Aug 2013

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc