0.4.0 • Published 7 years ago

xom v0.4.0

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

xom

TravisCI Coverage Dependencies Dev Dependencies npm version MIT License

Build DOM trees by misusing Proxy!

Features

  • Dynamic wrapper for document.createElement and document.createElementNS.
  • Use HTML or JavaScript attribute names.
  • Automatically wrap other arguments in document.createTextNode.

Install

npm install --save xom

Usage

Basic package usage:

import { dom } from 'xom'
const { div, span, b, i } = dom

document.appendChild(
  div({className: 'banana'},
    span('ba', b('na'), i('na'))
  )
)

Customize Xom:

import { Xom } from 'xom'

class MyXom extends Xom {}
const x = MyXom.proxy()

document.appendChild(
  x.div({className: 'banana'},
    x.span('ba', x.b('na'), x.i('na'))
  )
)
0.4.0

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago