json2dom-js

0.0.8 • Public • Published

json2dom-js

It will make HTML DOM from json format file.

Install

npm install json2dom-js

Sample Code

class Controller {
  beforeContentCreate(data){
    // some action for before create 'Content' element
    return true;
  }
}
const ctl = new Controller();
const Json2Dom = require('json2dom-js');
const j2d = new Json2Dom(ctl);
j2d.load('path/to/format.js').then((dom) => {
  const target = document.getElementById('target');
  target.appendChild(dom);
});

Sample JSON

{
  "$wrapper": {
    "type": "div",
    "style": "width: 100%; position:relative; margin:0 auto, background-color:#000;",
    "$content": {
      "type": "div"
    }
  }
}

Author

kuro-daei

Repository

GitHub

Lisence

Apache-2.0

Readme

Keywords

none

Package Sidebar

Install

npm i json2dom-js

Weekly Downloads

0

Version

0.0.8

License

none

Last publish

Collaborators

  • etrojan