Socket
Socket
Sign inDemoInstall

json-markup

Package Overview
Dependencies
0
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    json-markup

a json to html syntax highlighter


Version published
Maintainers
1
Install size
5.95 kB
Created

Changelog

Source

0.1.7 (2016-03-15)

  • #5 incorrect placement of comma after null values (be1ae6f)
  • 0.1.7 (c7168b1)

<a name="0.1.6"></a>

Readme

Source

json-markup

Prettyprint JSON to HTML

It is available through npm

npm install json-markup

or as a component for the browser

component install mafintosh/json-markup

json-markup will take a JSON document and add markup to it so it can be styled in a browser.

Usage

var jsonMarkup = require('json-markup');

var html = jsonMarkup({hello:'world'});

console.log(html);

The above example will print the following HTML

<div class="json-markup">{
	<span class="json-markup-key">hello:</span> <span class="json-markup-string">"world"</span>
}</div>

Afterwards you can use css to style your output to your liking. A stylesheet similar to JSON view is included in style.css

License

MIT

Keywords

FAQs

Last updated on 15 Mar 2016

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