{"_id":"@aliborsan/dommanager","_rev":"4-5786c1f9dee38441e780733154c4846d","name":"@aliborsan/dommanager","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.1":{"name":"@aliborsan/dommanager","version":"1.0.1","keywords":["dom","dom-manipulation","jquery","utility","vanilla-js"],"author":{"name":"Ali Borsan"},"license":"ISC","_id":"@aliborsan/dommanager@1.0.1","maintainers":[{"name":"aliborsan","email":"aliborsan@gmail.com"}],"homepage":"https://github.com/AliBorsan/domManager#readme","bugs":{"url":"https://github.com/AliBorsan/domManager/issues"},"dist":{"shasum":"503d55e618f81418ae73a489f3945cfb6d57e71a","tarball":"https://registry.npmjs.org/@aliborsan/dommanager/-/dommanager-1.0.1.tgz","fileCount":6,"integrity":"sha512-mvy8iqaS7UDpwpSrEAwiw51APaaXVog3yWvbxX+V15DZFv4VQklFwLv/M1aac58W88sx7zqJ5RB1RByCvJP1Cg==","signatures":[{"sig":"MEUCIHcIoXOxSwDZHo7zDRT642/g+S61pUfw+ITfQRFrB8lTAiEAs6Ejq23l+0gCazLuaNmHTtmb108BGTprahfG5cY59bE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":142543},"main":"domman.js","types":"index.d.ts","unpkg":"domman.js","browser":"domman.js","engines":{"node":">=18"},"exports":{".":{"types":"./index.d.ts","default":"./domman.js"}},"gitHead":"ce1ea94f7418716cb8308be7909d0426a75db610","scripts":{"test":"node --test"},"_npmUser":{"name":"aliborsan","email":"aliborsan@gmail.com"},"jsdelivr":"domman.js","repository":{"url":"git+https://github.com/AliBorsan/domManager.git","type":"git"},"_npmVersion":"10.9.2","description":"domMan (DOM Manager) is a lightweight, chainable DOM utility inspired by jQuery.","directories":{},"_nodeVersion":"22.17.0","_hasShrinkwrap":false,"devDependencies":{"jsdom":"^27.4.0"},"_npmOperationalInternal":{"tmp":"tmp/dommanager_1.0.1_1767114752265_0.7595499860232904","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@aliborsan/dommanager","version":"1.0.2","keywords":["dom","dom-manipulation","jquery","utility","vanilla-js"],"author":{"name":"Ali Borsan"},"license":"ISC","_id":"@aliborsan/dommanager@1.0.2","maintainers":[{"name":"aliborsan","email":"aliborsan@gmail.com"}],"homepage":"https://github.com/AliBorsan/domManager#readme","bugs":{"url":"https://github.com/AliBorsan/domManager/issues"},"dist":{"shasum":"92011af6467c07fc3a9057231475d1c58c832d20","tarball":"https://registry.npmjs.org/@aliborsan/dommanager/-/dommanager-1.0.2.tgz","fileCount":6,"integrity":"sha512-oiaLBD/I0iMpFSK4QhYF1iIhdSowAb1E7vhDFF4TBEYEUMYnk+DC0KQHg4uUkYDm6Uvcs2XGDylfy66AJCMCKg==","signatures":[{"sig":"MEUCIQDNBaf6SurC4GJzPhwAizRNvPfJKTAHJShRNcTJ8Rgs6QIgDvkI8lcOmJ53yo6ls1wMwSQno4hTnyat3vSfaFq17O8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":142833},"main":"domman.js","types":"index.d.ts","unpkg":"domman.js","browser":"domman.js","engines":{"node":">=18"},"exports":{".":{"types":"./index.d.ts","default":"./domman.js"}},"gitHead":"c5dd47351d245fb3f691ec63244e77b66cd16390","scripts":{"test":"node --test"},"_npmUser":{"name":"aliborsan","email":"aliborsan@gmail.com"},"jsdelivr":"domman.js","repository":{"url":"git+https://github.com/AliBorsan/domManager.git","type":"git"},"_npmVersion":"10.9.2","description":"domMan (DOM Manager) is a lightweight, chainable DOM utility inspired by jQuery.","directories":{},"_nodeVersion":"22.17.0","_hasShrinkwrap":false,"devDependencies":{"jsdom":"^27.4.0"},"_npmOperationalInternal":{"tmp":"tmp/dommanager_1.0.2_1767115039947_0.07302768375090762","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@aliborsan/dommanager","version":"1.0.3","keywords":["dom","dom-manipulation","jquery","utility","vanilla-js"],"author":{"name":"Ali Borsan"},"license":"ISC","_id":"@aliborsan/dommanager@1.0.3","maintainers":[{"name":"aliborsan","email":"aliborsan@gmail.com"}],"homepage":"https://github.com/AliBorsan/domManager#readme","bugs":{"url":"https://github.com/AliBorsan/domManager/issues"},"dist":{"shasum":"dfdb40a734897553c68acdd550c52be085783f72","tarball":"https://registry.npmjs.org/@aliborsan/dommanager/-/dommanager-1.0.3.tgz","fileCount":6,"integrity":"sha512-T5uWu2sH+TSdTbXW7ex7qv+OUjQrQmbVuf2oTqjiV2peFuQSQ7nAjmQET1dqm5XLWl/z3EbTjFFuusYNRWxptQ==","signatures":[{"sig":"MEUCIQCfc9eTzq5n/m/lsm7wL/cpf8sry7BJnkrtCuAvLpEAPgIgTsbFpViQvBGKK1yfv0GZwcr+cFqid4sZzWoopsXmVW4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":143114},"main":"domman.js","types":"index.d.ts","unpkg":"domman.js","browser":"domman.js","engines":{"node":">=18"},"exports":{".":{"types":"./index.d.ts","default":"./domman.js"}},"gitHead":"49f5ec6e7710a5ad53f236c5fc9df7f63c296112","scripts":{"test":"node --test"},"_npmUser":{"name":"aliborsan","email":"aliborsan@gmail.com"},"jsdelivr":"domman.js","repository":{"url":"git+https://github.com/AliBorsan/domManager.git","type":"git"},"_npmVersion":"10.9.2","description":"domMan (DOM Manager) is a lightweight, chainable DOM utility inspired by jQuery.","directories":{},"_nodeVersion":"22.17.0","_hasShrinkwrap":false,"devDependencies":{"jsdom":"^26.1.0"},"_npmOperationalInternal":{"tmp":"tmp/dommanager_1.0.3_1767180098432_0.6694672335033163","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@aliborsan/dommanager","version":"1.0.4","description":"domMan (DOM Manager) is a lightweight, chainable DOM utility inspired by jQuery.","main":"domman.js","browser":"domman.js","unpkg":"domman.js","jsdelivr":"domman.js","types":"index.d.ts","exports":{".":{"types":"./index.d.ts","default":"./domman.js"}},"scripts":{"test":"node --test"},"keywords":["dom","dom-manipulation","jquery","utility","vanilla-js"],"repository":{"type":"git","url":"git+https://github.com/AliBorsan/domManager.git"},"bugs":{"url":"https://github.com/AliBorsan/domManager/issues"},"homepage":"https://github.com/AliBorsan/domManager#readme","engines":{"node":">=18"},"author":{"name":"Ali Borsan"},"license":"ISC","devDependencies":{"jsdom":"^26.1.0"},"gitHead":"c4d4f7b650a6178ce01862f2d1733ec6f929d833","_id":"@aliborsan/dommanager@1.0.4","_nodeVersion":"24.15.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-gNnTpvvbSu6lteVugAICK+e6Hbt5fKUcnFuWfhXsQns/cPtQmg5xAIHp9uk/NQYzqz4WQfP3dtYrr955H8Go/w==","shasum":"ce7547c788355b0eb6e7f15f4776f49149efca08","tarball":"https://registry.npmjs.org/@aliborsan/dommanager/-/dommanager-1.0.4.tgz","fileCount":6,"unpackedSize":143105,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDmilIA3+RDiWrZ1j4ARrrxnorX4ZGml8YtlvACx/8XEAiEAkv9JBgkJGc2yEabDKm/R2znyehjgDH6rd+CeVFG/IxI="}]},"_npmUser":{"name":"aliborsan","email":"aliborsan@gmail.com"},"directories":{},"maintainers":[{"name":"aliborsan","email":"aliborsan@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dommanager_1.0.4_1785508649685_0.9637054129421465"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-30T17:12:32.184Z","modified":"2026-07-31T14:37:29.969Z","1.0.1":"2025-12-30T17:12:32.427Z","1.0.2":"2025-12-30T17:17:20.104Z","1.0.3":"2025-12-31T11:21:38.574Z","1.0.4":"2026-07-31T14:37:29.826Z"},"bugs":{"url":"https://github.com/AliBorsan/domManager/issues"},"author":{"name":"Ali Borsan"},"license":"ISC","homepage":"https://github.com/AliBorsan/domManager#readme","keywords":["dom","dom-manipulation","jquery","utility","vanilla-js"],"repository":{"type":"git","url":"git+https://github.com/AliBorsan/domManager.git"},"description":"domMan (DOM Manager) is a lightweight, chainable DOM utility inspired by jQuery.","maintainers":[{"name":"aliborsan","email":"aliborsan@gmail.com"}],"readme":"# domMan\n\n[![npm version](https://img.shields.io/npm/v/%40aliborsan%2Fdommanager.svg)](https://www.npmjs.com/package/@aliborsan/dommanager) [![CI](https://github.com/AliBorsan/domManager/actions/workflows/ci.yml/badge.svg)](https://github.com/AliBorsan/domManager/actions/workflows/ci.yml)\n\ndomMan stands for **DOM Manager**.\n\nA lightweight, chainable DOM utility inspired by jQuery.\n\ndomMan focuses on:\n\n- A small, practical chainable API (`$d(...)` / `domMan(...)`)\n- Multi-selection safety (setters/actions apply to all matches; getters read from the first)\n- A modern event API (direct + delegated, `one()`, `trigger()`, event namespaces)\n- A Proxy-powered “dynamic API” for ergonomic DOM/CSS/property shortcuts\n\nThis repo includes automated tests (Node test runner + jsdom) and TypeScript typings.\n\n## Table of contents\n\n- Install\n- Quick start\n- Core conventions\n- Common recipes\n- Events (including namespaces)\n- API reference (by category)\n- Proxy-powered dynamic API\n- Migration from jQuery (quick equivalents)\n- Gotchas & notes\n- Versioning & API stability\n- Browser support\n- TypeScript\n- Demos\n- Tests\n- Contributing\n- License & policies\n\n## Install\n\n### npm\n\n```bash\nnpm i @aliborsan/dommanager\n```\n\nThen in a bundler / Node environment:\n\n```js\nimport domMan from '@aliborsan/dommanager';\n\n// Optional alias (to match the docs)\nconst $d = domMan;\n```\n\n### Local/dev (this repo)\n\n```bash\nnpm install\n```\n\n### Browser (UMD)\n\nInclude the UMD file directly:\n\n```html\n<script src=\"domman.js\"></script>\n```\n\nYou get globals:\n\n- `window.$d`\n- `window.domMan`\n\n## Quick start\n\n```html\n<button id=\"btn\">Click</button>\n<ul id=\"list\">\n  <li class=\"item\">One</li>\n  <li class=\"item\">Two</li>\n</ul>\n\n<script src=\"domman.js\"></script>\n<script>\n  // Select\n  const $btn = $d('#btn');\n\n  // Setters/actions apply to all matched elements\n  $d('.item')\n    .addClass('active')\n    .css('color', 'red');\n\n  // Getters read from the first matched element\n  const firstText = $d('.item').text();\n  console.log(firstText);\n\n  // Events\n  $btn.on('click', () => console.log('clicked'));\n\n  // Delegated events\n  $d('#list').on('click', 'li', (e, matched) => {\n    console.log('clicked item', matched);\n  });\n</script>\n```\n\n## Core conventions\n\n### What you can pass to `$d(...)`\n\n`$d()` accepts:\n\n- CSS selector string\n- a single `Element`\n- a `NodeList` / `HTMLCollection`\n- an `Element[]`\n- another `domMan` instance\n\n### Setters vs getters (multi-selection semantics)\n\ndomMan follows a predictable rule:\n\n- **Setters/actions** apply to **all** matched elements and return `this` for chaining.\n  - Examples: `addClass`, `remove`, `css`, `cssObject`, `html('...')`, `append(...)`, `on(...)`\n- **Getters/queries** read from the **first** matched element.\n  - Examples: `html()`, `text()`, `val()`, `hasClass()`, `getAttribute()`\n\nThis keeps behavior consistent even when a selector matches multiple elements.\n\n## Common recipes\n\n### Create elements\n\n```js\nconst el = $d().createElement('button', {\n  className: 'btn',\n  style: { padding: '8px 12px' },\n  onclick: () => console.log('hello'),\n});\n\n$d('#root').append(el);\n```\n\n### Insert content\n\n```js\n$d('#root').append('Hello');\n$d('#root').pre('Start: ');\n\n// Before/after a target\n$d('#target').before('Before ');\n$d('#target').after(' After');\n```\n\n### Traverse\n\n```js\n// Union of parents for multi-selection\nconst $parents = $d('.item').parent();\n\n// Flattened children across all matches\nconst $kids = $d('#list').children();\n\n// Unique siblings excluding the selection\nconst $sib = $d('.item').siblings();\n```\n\n### Data storage (in-memory)\n\n```js\n$d('.item').data('role', 'row');      // sets on all\nconsole.log($d('.item').data('role')); // reads from first\n\n$d('.item').removeData('role');\n```\n\n### LocalStorage helpers\n\n```js\n$d().setLocalStorage('prefs', { theme: 'dark' });\nconsole.log($d().getLocalStorage('prefs'));\n$d().removeLocalStorage('prefs');\n```\n\n## Events\n\n### Direct events\n\n```js\n$d('#btn').on('click', (e) => {\n  console.log('clicked', e.target);\n});\n```\n\n### Delegated events\n\n```js\n$d('#list').on('click', 'li', function (e, matched) {\n  // `this` is the matched element\n  console.log('clicked item', matched);\n});\n```\n\n### `one()` (once)\n\n```js\n$d('#btn').one('click', () => {\n  console.log('runs once');\n});\n```\n\n### `off()` (remove listeners)\n\n```js\nfunction onClick() {\n  console.log('clicked');\n}\n\n$d('#btn').on('click', onClick);\n$d('#btn').off('click', onClick);\n```\n\nDelegated removal:\n\n```js\nfunction onItemClick(e) {\n  console.log('delegated', this);\n}\n\n$d('#list').on('click', 'li', onItemClick);\n$d('#list').off('click', 'li', onItemClick);\n```\n\n### `trigger()` / `triggerHandler()`\n\n```js\n$d('#btn').trigger('click');\n\n// Like jQuery triggerHandler(): dispatches only on first match, without bubbling\n$d('#btn').triggerHandler('custom', { any: 'data' });\n```\n\n### Namespaced events\n\nFor **known DOM events**, you can namespace handlers with `type.namespace`:\n\n```js\n$d('#btn').on('click.menu', () => console.log('menu click'));\n$d('#btn').on('click.other', () => console.log('other click'));\n\n// Remove only the \".menu\" handlers (including delegated ones)\n$d('#btn').off('.menu');\n```\n\nImportant:\n\n- Namespace-only strings like `.menu` are only meaningful for `off('.menu')`.\n- Custom event names containing dots (e.g. `hello.world`) are treated as a single custom event name, not a namespace.\n\n## API reference (by category)\n\nBelow is a practical overview of the public API in this build.\n\n### Selection\n\n- `$d(selectorOrElementOrList)`\n- `.length` — number of matched elements\n- `.toArray()` / `.asArray()` — get a normalized `Element[]`\n\n### Content\n\n- `.val(value?)` — get/set input value\n- `.text(t?)` — get/set innerText\n- `.textContent(text?)` — get/set textContent\n- `.html(html?)` — get/set innerHTML\n- `.outerHTML(html?)` — get/set outerHTML\n\n### Classes\n\n- `.addClass(name)`\n- `.removeClass(name)`\n- `.toggleClass(name)`\n- `.hasClass(name)`\n\n### Styles\n\n- `.css(prop, value)`\n- `.cssObject({ ... })`\n- `.cssVar(nameOrObject, value?)`\n\n### DOM insertion\n\n- `.append(ctn)` / `.pre(ctn)`\n- `.before(ctn)` / `.after(ctn)`\n- `.appendTo(target)` / `.prependTo(target)`\n\nWhen multiple targets are matched, Node inputs are cloned as needed so each target gets a copy.\n\n### Traversal\n\n- `.parent()` — unique parents\n- `.children()` — flattened children\n- `.siblings()` — unique siblings excluding selection\n- `.next()` / `.prev()` — unions for multi-selection\n\n### Attributes + node helpers\n\n- `.getAttribute(name)` (first element)\n- `.setAttribute(name, value)` (all)\n- `.removeAttribute(name)` (all)\n- `.hasAttribute(name)` (first)\n- `.childNodes()` (first)\n- `.firstChild()` / `.lastChild()` (first)\n\n### Data\n\n- `.data(key?, value?)`\n- `.removeData(key?)`\n\n### Local storage\n\n- `.setLocalStorage(key, value)`\n- `.getLocalStorage(key)`\n- `.removeLocalStorage(key)`\n- `.clearLocalStorage()`\n\n### AJAX\n\n- `.ajax({ method, url, data, headers, responseType })` (Promise)\n- `.get(url, data?, options?)`\n- `.post(url, data?, options?)`\n\nExample:\n\n```js\n// GET\n$d()\n  .get('https://httpbin.org/json')\n  .then((json) => console.log('json keys:', Object.keys(json)))\n  .catch((err) => console.log('ajax error (CORS/file://):', err));\n\n// POST (JSON body)\n$d()\n  .post('https://httpbin.org/post', { hello: 'world' }, {\n    headers: { 'Content-Type': 'application/json' },\n  })\n  .then((res) => console.log('posted ok:', !!res))\n  .catch((err) => console.log('ajax error:', err));\n```\n\n### Forms + validation\n\n- `.serializeForm(format?)` where `format` is `\"object\" | \"json\" | \"urlencoded\"`\n- `.submitForm(ajax?, callback?)`\n- `.resetForm()`\n- `.formValue(name?, value?)`\n- `.validate(rules?, options?)`\n- `.applyValidationAttributes(rules)`\n\nExamples:\n\n```js\n// Serialize form\nconst formEl = document.querySelector('#myForm');\nconst obj = $d(formEl).serializeForm('object');\nconsole.log(obj);\n\n// Get/set individual values\nconsole.log($d(formEl).formValue('email'));\n$d(formEl).formValue('email', 'a@example.com');\n```\n\n```js\n// Validate\nconst rules = {\n  email: { required: true, pattern: 'email' },\n  age: { min: 18, max: 120 },\n};\n\nconst ok = $d('#myForm').validate(rules);\nconsole.log('valid?', ok);\n\n// Apply validation attributes to inputs (required/pattern/min/max/minlength/maxlength)\n$d('#myForm').applyValidationAttributes(rules);\n```\n\n```js\n// Submit helper (AJAX mode)\n$d('#myForm').submitForm(true, (err, response) => {\n  if (err) return console.log('submit failed:', err);\n  console.log('submit response:', response);\n});\n```\n\n### Observers\n\n- `.onResize(callback)` / `.unobserveResize()`\n- `.onIntersect(callback, options?)`\n- `.whenVisible(callback, { once?, root?, rootMargin?, threshold? })`\n- `.unobserve()` (disconnects stored observers)\n\nExample:\n\n```js\n// ResizeObserver\n$d('#panel').onResize((entry, el) => {\n  console.log('resized:', el, entry && entry.contentRect);\n});\n\n// IntersectionObserver (runs whenever visibility changes)\n$d('#hero').onIntersect((entry, el) => {\n  console.log('intersection:', entry.isIntersecting, el);\n});\n\n// Run once when visible\n$d('#lazy').whenVisible(() => {\n  console.log('lazy is visible');\n}, { once: true });\n```\n\n### Animations + transitions\n\n- `.fadeIn(duration?)`\n- `.animate(props, duration?, easing?, callback?)`\n- `.animateKeyframes(keyframes, options?)`\n- `.pauseAnimation()` / `.resumeAnimation()` / `.cancelAnimation()`\n- `.addClassWithTransition(className, duration?, easing?)`\n\nExamples:\n\n```js\n$d('#box').fadeIn(200);\n\n$d('#box').animate(\n  { opacity: '0.5', transform: 'translateX(12px)' },\n  300,\n  'ease',\n  function () {\n    console.log('done', this);\n  }\n);\n```\n\n```js\n// Web Animations API wrapper (if supported by the browser)\n$d('#box').animateKeyframes(\n  [\n    { transform: 'translateX(0px)' },\n    { transform: 'translateX(40px)' },\n  ],\n  { duration: 250, fill: 'forwards' }\n);\n\n// Later:\n$d('#box').pauseAnimation();\n$d('#box').resumeAnimation();\n// or:\n$d('#box').cancelAnimation();\n```\n\n### Pagination\n\n- `.paginate(items, itemsPerPage, renderItem, options?)`\n\nExample:\n\n```js\nconst items = ['a', 'b', 'c', 'd', 'e'];\n\n$d('#list').paginate(\n  items,\n  2,\n  (item) => {\n    const li = document.createElement('li');\n    li.textContent = item;\n    return li;\n  },\n  { showFirstLast: true }\n);\n```\n\n### Plugins (extend)\n\n- `.extend({ methodName() { ... } })` (adds to the active domMan prototype)\n\nExample:\n\n```js\n$d().extend({\n  flash() {\n    return this.addClass('flash');\n  },\n});\n\n$d('.item').flash();\n```\n\n### noConflict\n\n- `domMan.noConflict(deep?)`\n\nExample:\n\n```js\n// Restore prior globals and return domMan\nconst dm = window.domMan.noConflict();\n\n// Or get an isolated clone (deep prototype clone)\nconst dmClone = window.domMan.noConflict(true);\ndmClone('.item').addClass('from-clone');\n```\n\n### cssPseudo\n\n- `.cssPseudo(pseudoClass, styles, baseStyles?, options?)`\n\nExample:\n\n```js\n$d('.btn').cssPseudo(\n  'hover',\n  { backgroundColor: '#222', color: '#fff' },\n  { backgroundColor: '#eee', color: '#111' },\n  { duration: 200, timing: 'ease' }\n);\n```\n\n### Events\n\n- `.on(evt, handler, options?)`\n- `.on(evt, selector, handler, options?)` (delegated)\n- `.off(evt?, handler?)` and delegated variants\n- `.one(...)` (same overloads as `.on()`; runs once)\n- `.trigger(evt, detail?, eventInit?)`\n- `.triggerHandler(evt, detail?, eventInit?)`\n\n## Proxy-powered dynamic API\n\nThis build wraps `domMan.pt` in a Proxy so some properties behave like helpers.\n\n### Event shortcuts\n\nFor common DOM events, you can use:\n\n```js\n// Trigger\n$d('#btn').click();\n\n// Bind\n$d('#btn').click(() => console.log('clicked'));\n```\n\n### DOM property routing (guarded)\n\nIf the property exists on the first element, getters read from the first element and setters apply to all matched elements.\n\nThis behavior is intentionally guarded (`prop in firstElement`) to avoid collisions with CSS-like names.\n\n## Migration from jQuery (quick equivalents)\n\ndomMan is not a full jQuery clone, but many everyday patterns translate cleanly.\n\n### Selection\n\n```js\n// jQuery:  const $el = $('#id')\nconst $el = $d('#id');\n\n// jQuery:  $(element)\nconst $wrapped = $d(element);\n\n// jQuery:  $(nodeList)\nconst $list = $d(document.querySelectorAll('.item'));\n```\n\n### Text/HTML/value\n\n```js\n// jQuery:  $el.text('hi') / $el.text()\n$d('#id').text('hi');\nconst t = $d('#id').text();\n\n// jQuery:  $el.html('<b>x</b>') / $el.html()\n$d('#id').html('<b>x</b>');\nconst h = $d('#id').html();\n\n// jQuery:  $input.val('a') / $input.val()\n$d('#input').val('a');\nconst v = $d('#input').val();\n```\n\n### Classes + styles\n\n```js\n// jQuery: $el.addClass/removeClass/toggleClass/hasClass\n$d('.item').addClass('active');\n$d('.item').removeClass('active');\n$d('.item').toggleClass('active');\nconst ok = $d('.item').hasClass('active');\n\n// jQuery: $el.css('color', 'red')\n$d('.item').css('color', 'red');\n\n// jQuery: $el.css({ color: 'red', backgroundColor: 'black' })\n$d('.item').cssObject({ color: 'red', backgroundColor: 'black' });\n```\n\n### Insert content\n\n```js\n// jQuery: $el.append(x) / $el.prepend(x)\n$d('#root').append('Hello');\n$d('#root').pre('Start: ');\n\n// jQuery: $el.before(x) / $el.after(x)\n$d('#target').before('Before ');\n$d('#target').after(' After');\n```\n\n### Events\n\n```js\n// jQuery: $el.on('click', fn)\n$d('#btn').on('click', fn);\n\n// jQuery: $el.on('click', 'li', fn) (delegation)\n$d('#list').on('click', 'li', fn);\n\n// jQuery: $el.one('click', fn)\n$d('#btn').one('click', fn);\n\n// jQuery: $el.off('click', fn)\n$d('#btn').off('click', fn);\n\n// jQuery: $el.trigger('click')\n$d('#btn').trigger('click');\n```\n\n## Gotchas & notes\n\n### Multi-selection behavior is intentional\n\n- Setters/actions apply to **all** matched elements.\n- Getters read from the **first** matched element.\n\nIf you need the raw elements, use `.toArray()` / `.asArray()`.\n\n### Node cloning with multi-target insertion\n\nMethods like `.append()`, `.pre()`, `.before()`, `.after()`, `.appendChild()` will clone `Node` inputs as needed when multiple targets are matched.\n\nExample:\n\n```js\nconst node = document.createElement('span');\nnode.textContent = 'Hi';\n\n// If multiple targets match, domMan clones `node` so each target gets a copy.\n$d('.item').append(node);\n```\n\n### Namespaces are only for known DOM events\n\n- `click.menu` is treated as a namespaced DOM event handler.\n- `.menu` by itself is used for `off('.menu')` (namespace-only removal).\n- Custom events containing dots (example: `hello.world`) are treated as a single event name.\n\n### Proxy behavior is convenient, but not magic\n\nThe Proxy dynamic API is designed to be ergonomic while avoiding common collisions:\n\n- Direct methods on `domMan.pt` win.\n- DOM property routing only happens when the property exists on the first element.\n- Use explicit methods when you want clarity (`css()`, `setAttribute()`, etc.).\n\n## Versioning & API stability\n\nThis project is still evolving.\n\n- Expect small API refinements as docs, tests, and typing coverage improve.\n- If you plan to publish, it’s recommended to follow SemVer and document breaking changes in release notes.\n- The test suite in [test/domman.test.js](test/domman.test.js) is the “source of truth” for current behavior.\n\n## Browser support\n\ndomMan is designed for modern browsers.\n\n- The codebase uses `Proxy`, `Map`, `WeakMap`, `CustomEvent`, and `Element.closest()`.\n- If you need to support older browsers (notably legacy IE), you will likely need transpilation and/or polyfills.\n\n## TypeScript\n\nTypes live in [index.d.ts](index.d.ts) and are referenced from `package.json`.\n\n## Demos\n\n- [usage.html](usage.html) + [usage-samples.js](usage-samples.js)\n- [dom-usage.html](dom-usage.html) + [dom-usage.js](dom-usage.js)\n\n### Heavy-method examples in the demo\n\nThe interactive demo in [usage-samples.js](usage-samples.js) includes click-to-run examples for:\n\n- AJAX (`get()` / `ajax()`)\n- Forms (`serializeForm()`)\n- Animations (`animate()`)\n- Traversal + iteration (`find()` + `each()`)\n- `noConflict()`\n\nOpen the HTML files in a browser (or via a local static server) to try the examples.\n\n## Tests\n\n```bash\nnpm test\n```\n\nTests live in [test/domman.test.js](test/domman.test.js).\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md).\n\n## License & policies\n\n- License: [LICENSE](LICENSE)\n- Code of Conduct: [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md)\n- Security: [SECURITY.md](SECURITY.md)\n- Changelog: [CHANGELOG.md](CHANGELOG.md)\n","readmeFilename":"README.md"}