Skip to content

Automattic/json-to-html

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Convert JSON Object to HTML.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%