@nura-js/dom
v0.1.1
Published
DOM indexing and scanning for Nura.js
Downloads
8
Maintainers
Readme
@nura-js/dom
DOM indexer utilities that locate Nura verbs, scopes, and metadata directly in the browser.
Installation
pnpm add @nura-js/domUsage Example
import { DOMIndexer, scanDOM } from '@nura-js/dom';
const indexer = new DOMIndexer({ autoScan: true });
const indexed = indexer.getAll();
console.log('Indexed elements', indexed.length);
const snapshot = scanDOM(document.body);
console.log(snapshot.stats.byScope.orders);Key APIs
DOMIndexerobserves the DOM and maintains a reactive index fordata-nu-*attributes.scanDOM(root?)performs an ad-hoc scan and returns metrics grouped by scope and verb.findElementsByScope(scope)finds elements by scope name.findElementsByVerb(verb)returns elements bound to a specific verb.
Type References
DOMIndexerOptions— configuration for auto-scan and observers.ScanResult— output fromscanDOMwith stats and node collections.NuraElement— indexed element model compatible with@nura-js/core.
Additional Resources
- Repository: https://github.com/nura-ia/nurajs
- Issues: https://github.com/nura-ia/nurajs/issues
