Skip to content
💫 Convert JSON Object to HTML.
JavaScript
Latest commit 2d4ab3e Dec 17, 2013 @frozzare Update README.md
Failed to load latest commit information.
test
.gitignore missed to add node_modules to gitignore Aug 9, 2012
.npmignore
MIT-LICENSE
Makefile
README.md
example.js
index.js add key / value classnames to strings Jul 4, 2013
package.json

README.md

json-to-html

Convert JSON Object to HTML.

Grunt plugin: https://github.com/frozzare/grunt-json-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

Something went wrong with that request. Please try again.