Skip to content
/ live-dom Public

A lightweight HTML parser & virtual DOM implementation intended for live coding

License

Notifications You must be signed in to change notification settings

0la0/live-dom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Live-DOM

A lightweight HTML parser & virtual DOM implementation intended for live coding

Build scripts

install dependencies: npm install
run tests: npm test
run linter: npm run lint


Usage

import LiveDom from 'live-dom';

const domNode = document.getElementById('foo'); // render input to this DOM node

const liveDom = new LiveDom({ domNode });

// or initialize with an html string
// new LiveDom({ domNode, htmlString: '<p>hello</p>' })

liveDom.setHtml('<p id="cool">hello</p>'); // apply document changes
liveDom.setHtml('<p id="something-else">hello</p>'); // apply more changes

liveDom.dispose(); // clears dom node, removes dom node if it is attached to a parent

About

A lightweight HTML parser & virtual DOM implementation intended for live coding

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published