json-to-html

0.1.2 • Public • Published

json-to-html

Convert JSON Object to HTML.

Installation

npm install json-to-html

Usage

var json2html = require('json-to-html')
  , html = json2html({ 'hello': 'world' });
 
console.log(html);

output:

{
  <span class="string">"hello"</span><span class="string">"world"</span>
}

2 space indentation is default. Change it by adding a numeric argument to json2html.

var html = json2html(object, 4);

Every operand has a span added around it self with different classnames.

string, boolean, number or null.

License

See MIT-LICENSE

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.2
    11,224
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.2
    11,224
  • 0.1.1
    0
  • 0.1.0
    1

Package Sidebar

Install

npm i json-to-html

Weekly Downloads

11,225

Version

0.1.2

License

MIT

Last publish

Collaborators

  • frozzare