DiWu (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/michael-tiger-2010/wyvernjs/llms.txt
Use this file to discover all available pages before exploring further.
dw) is WyvernJS’s DOM module. It extends HTMLElement, Element, EventTarget, and Promise prototypes with ergonomic methods that chain fluently and integrate with the Web Animations API. Rather than wrapping elements in a custom object, DiWu works directly on native DOM nodes — every method you call is genuinely on the element itself.
Initialization
Before any DiWu methods are available, calldw.init(). This walks the internal method registry and attaches each method to its target prototype, skipping any that are already defined (unless you explicitly force them).
params corresponds directly to a method DiWu would otherwise add. Pass false to skip a method entirely, or 'force' to override an existing definition on the prototype.
on, off, once, promiseMeOnce, animateTo, addChildren, appendTo, prependTo, replaceAs, empty, prepend, append, text, html, setAttrs, setClasses, removeClasses, qs, qsa, $, css, thendo, hide, show, toggle, wait, siblings, classes, attrs.
Feature Overview
Events
.on(), .off(), .once(), and .promiseMeOnce() — WeakMap-backed event management on EventTarget.DOM Manipulation
Chainable content setters, append/prepend helpers, visibility toggles, and Proxy-based class/attribute access.
Animation
.animateTo() wraps the Web Animations API and commits the final state. .thendo() hooks into any transition or animation end.Querying & Styling
.qs(), .qsa(), and .$() as scoped selector shorthands, plus .css() for inline style objects.Quick example
Oncedw.init() has run, every native DOM element gains DiWu’s methods. The following chain queries an element, styles it, sets its text, attaches a class, registers a click listener, and moves it into document.body — all in one expression: