1.6.8 • Published 7 years ago

js-to-divs v1.6.8

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

json-to-divs

Convert a json object into a tree of divs for easily displaying using css.

See Specification for examples.

Reason

JSON is a great format for creating unstructured, or semi-structured data. It doesn't, however, show up too well on a browser.

This utility converts a json object in set of nested divs, with classes for easy formatting, using plain old CSS.

It produces the html frag with no new lines or indentation. If you need this, try 'xml-formatter'.

Demo

Paste this in to runkit

var divs = require("js-to-divs");
var format = require("xml-formatter");

format( '<html><header></header><body>' + divs({hello:'world'}) + '</body></html>');

Test

Clone me, and run npm run qa

Notes:

This package has no production dependencies.

Maintain compatibility with node4+.

CI is on Travis

TODO:

  • Make me run from command line
1.6.8

7 years ago

1.6.7

7 years ago

1.6.5

7 years ago

1.6.4

7 years ago

1.6.2

7 years ago

1.6.1

7 years ago

1.6.0

7 years ago

1.5.0

7 years ago

1.4.0

7 years ago

1.3.0

7 years ago

1.2.0

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago