A tiny (less than 200 bytes) string to DOM element parser
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
dist
test
.gitignore
README.md
bower.json
index.js
package.json

README.md

tiny-dom-parser

A tiny (less than 200 bytes) DOM parser. Works as a standalone or with Browserify.

browser support

Install

NPM

npm install tiny-dom --save

Bower

bower install tiny-dom --save
<script src="bower-components/tiny-dom/dist/tinydom.js"></script>

Usage

If html is passed to the function, it returns a DOM element. If text is passed function, it return a text node.

Browser

var dom = window.tinyDom;

var el = dom('<ul id="tiny-dom"><li>1</li></ul>');
document.body.appendChild(el);

Browserify

var dom = require('tiny-dom');

var el = dom('<ul id="tiny-dom"><li>1</li></ul>');
document.body.appendChild(el);

Run Tests

Requires Phantomjs is installed

npm install
npm test