💫 Convert JSON Object to HTML. (not maintained)
JavaScript Makefile
Latest commit 07c45bf Jul 29, 2016 1 @frozzare Fix test
Permalink
Failed to load latest commit information.
dist chore: add dist Jul 29, 2016
test Fix test Jul 29, 2016
.eslintrc.js
.gitignore
.npmignore first commit Aug 9, 2012
MIT-LICENSE
Makefile
README.md Update README.md Dec 17, 2013
example.js feat: hyperlink URLs in strings Jul 29, 2016
index.js
package.json Fix test Jul 29, 2016
webpack.config.js feat: webpack Jul 29, 2016

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