1.0.1 • Published 7 years ago

generate-html v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
7 years ago

generate-html

Usage

Basis

var gHTML = require('generate-html');

var html = gHTML({tagname:{attrs:{attrname:"value"},value:"value"}});

example

var gHTML = require('generate-html'),
    html = gHTML({
      div:{
        attrs:{
          id:"container",
        },
        tags:{
          img:{
            src:"http://hoge/huga.png",
            class:"image"
          }
        }
      },
      p:{
        attrs:{
          id:"title"
        },
        value:"hi"
      }
    });
console.log(html);

example result

<div id="container" >
        <img src="http://hoge/huga.png" class="image" >
        </img>
</div>
<p id="title" >hi</p>

Install

$ npm install generate-html