Simple ES6 utility library for DOM manipulation, providing JSX-compatible createElement, show/hide, event listener, and insertion methods. Version 1.1.0 is current but shows no recent updates. Designed as a native ES6 module requiring Babel/Rollup for browser use. Lightweight alternative to React for basic DOM tasks, but lacks TypeScript definitions and broader ecosystem support. Similar to hyperscript or virtual-dom but with fewer features.
npm install dom-magicNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to create a DOM element with an event listener and append it to a container.
Set up a build pipeline with Babel and Rollup as described in README.
Consider using a maintained alternative like htm or preact for lightweight DOM manipulation.
Install @types/dom-magic if available, or declare module manually.
Always check if element exists before operating on it.
Add 'plugins' in babel config: [['@babel/plugin-transform-react-jsx', { pragma: 'createElement' }]]Ensure you import { createElement } from 'dom-magic' and set Babel pragma to createElement.Verify the selector string is correct and the DOM element exists before calling appendChild.
Use a bundler (Rollup, Webpack) or set <script type="module"> and ensure the file is served correctly.
No dependency data recorded yet.