/*{
  "id":"mdisp",
	"process":["browser"],
	"desc":"micro display",
  "deps":["mdisp.html","mdisp.styl"]
}*/
var stream = require('stream')
, inherits = require('inherits')

function mdisp (template) {
  stream.Stream.call(this)
  this.readable = true
  this.writable = true
  var self = this
  , element = null

  this._read = function (size) {}
  this.write = function (chunk) {
    console.log(chunk)
  }

  render(template)

  function render (html) {
    var container = document.getElementById('container')
    disp = document.createElement('div')
    disp.innerHTML = html
    container.appendChild(disp)
  }
}

inherits(mdisp,stream.Stream)
module.exports = mdisp 

/*{
  "id":"mdisp",
	"process":["browser"],
	"desc":"micro display",
  "deps":["mdisp.html","mdisp.styl"]
}*/

var through = require('through')

module.exports = Mdisp

function Mdisp (template) {
  var self = this
  this.s = through(write, end,{autoDestroy:false})

  function write (chunk) {
    this.queue(chunk)
  }

  function end () {
    this.emit('end')
  }

  render(template)

  function render (html) {
    var container = document.getElementById('container')
    disp = document.createElement('div')
    disp.innerHTML = html
    container.appendChild(disp)
  }
}

convert mdisp to through & tidy